Files
esengine/source/docs/classes/_utils_timers_timermanager_.es.timermanager.html

443 lines
23 KiB
HTML
Raw Normal View History

2020-11-20 14:07:34 +08:00
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>TimerManager | @esengine/egret-framework</title>
<meta name="description" content="Documentation for @esengine/egret-framework">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">@esengine/egret-framework</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
<input type="checkbox" id="tsd-filter-externals" checked />
<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
<input type="checkbox" id="tsd-filter-only-exported" />
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../globals.html">Globals</a>
</li>
<li>
<a href="../modules/_utils_timers_timermanager_.html">&quot;Utils/Timers/TimerManager&quot;</a>
</li>
<li>
<a href="../modules/_utils_timers_timermanager_.es.html">es</a>
</li>
<li>
<a href="_utils_timers_timermanager_.es.timermanager.html">TimerManager</a>
</li>
</ul>
<h1>Class TimerManager</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>允许动作的延迟和重复执行</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<a href="_utils_globalmanager_.es.globalmanager.html" class="tsd-signature-type">GlobalManager</a>
<ul class="tsd-hierarchy">
<li>
<span class="target">TimerManager</span>
</li>
</ul>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="_utils_timers_timermanager_.es.timermanager.html#_enabled" class="tsd-kind-icon">_enabled</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_utils_timers_timermanager_.es.timermanager.html#_timers" class="tsd-kind-icon">_timers</a></li>
</ul>
</section>
<section class="tsd-index-section tsd-is-inherited">
<h3>Accessors</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><a href="_utils_timers_timermanager_.es.timermanager.html#enabled" class="tsd-kind-icon">enabled</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="_utils_timers_timermanager_.es.timermanager.html#ondisabled" class="tsd-kind-icon">on<wbr>Disabled</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="_utils_timers_timermanager_.es.timermanager.html#onenabled" class="tsd-kind-icon">on<wbr>Enabled</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_utils_timers_timermanager_.es.timermanager.html#schedule" class="tsd-kind-icon">schedule</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="_utils_timers_timermanager_.es.timermanager.html#setenabled" class="tsd-kind-icon">set<wbr>Enabled</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-overwrite"><a href="_utils_timers_timermanager_.es.timermanager.html#update" class="tsd-kind-icon">update</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a name="_enabled" class="tsd-anchor"></a>
<h3>_enabled</h3>
<div class="tsd-signature tsd-kind-icon">_enabled<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="_utils_globalmanager_.es.globalmanager.html">GlobalManager</a>.<a href="_utils_globalmanager_.es.globalmanager.html#_enabled">_enabled</a></p>
<ul>
<li>Defined in <a href="https://github.com/esengine/egret-framework/blob/562bacb/source/src/Utils/GlobalManager.ts#L3">src/Utils/GlobalManager.ts:3</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="_timers" class="tsd-anchor"></a>
<h3>_timers</h3>
<div class="tsd-signature tsd-kind-icon">_timers<span class="tsd-signature-symbol">:</span> <a href="_utils_timers_timer_.es.timer.html" class="tsd-signature-type">Timer</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/esengine/egret-framework/blob/562bacb/source/src/Utils/Timers/TimerManager.ts#L6">src/Utils/Timers/TimerManager.ts:6</a></li>
</ul>
</aside>
</section>
</section>
<section class="tsd-panel-group tsd-member-group tsd-is-inherited">
<h2>Accessors</h2>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited">
<a name="enabled" class="tsd-anchor"></a>
<h3>enabled</h3>
<ul class="tsd-signatures tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> enabled<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">set</span> enabled<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<p>Inherited from <a href="_utils_globalmanager_.es.globalmanager.html">GlobalManager</a>.<a href="_utils_globalmanager_.es.globalmanager.html#enabled">enabled</a></p>
<ul>
<li>Defined in <a href="https://github.com/esengine/egret-framework/blob/562bacb/source/src/Utils/GlobalManager.ts#L9">src/Utils/GlobalManager.ts:9</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>如果true则启用了GlobalManager。
状态的改变会导致调用OnEnabled/OnDisable</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
</li>
<li class="tsd-description">
<aside class="tsd-sources">
<p>Inherited from <a href="_utils_globalmanager_.es.globalmanager.html">GlobalManager</a>.<a href="_utils_globalmanager_.es.globalmanager.html#enabled">enabled</a></p>
<ul>
<li>Defined in <a href="https://github.com/esengine/egret-framework/blob/562bacb/source/src/Utils/GlobalManager.ts#L18">src/Utils/GlobalManager.ts:18</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>如果true则启用了GlobalManager。
状态的改变会导致调用OnEnabled/OnDisable</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>value: <span class="tsd-signature-type">boolean</span></h5>
<div class="tsd-comment tsd-typography">
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a name="ondisabled" class="tsd-anchor"></a>
<h3>on<wbr>Disabled</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">on<wbr>Disabled<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<p>Inherited from <a href="_utils_globalmanager_.es.globalmanager.html">GlobalManager</a>.<a href="_utils_globalmanager_.es.globalmanager.html#ondisabled">onDisabled</a></p>
<ul>
<li>Defined in <a href="https://github.com/esengine/egret-framework/blob/562bacb/source/src/Utils/GlobalManager.ts#L46">src/Utils/GlobalManager.ts:46</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>此GlobalManager禁用时调用</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a name="onenabled" class="tsd-anchor"></a>
<h3>on<wbr>Enabled</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">on<wbr>Enabled<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<p>Inherited from <a href="_utils_globalmanager_.es.globalmanager.html">GlobalManager</a>.<a href="_utils_globalmanager_.es.globalmanager.html#onenabled">onEnabled</a></p>
<ul>
<li>Defined in <a href="https://github.com/esengine/egret-framework/blob/562bacb/source/src/Utils/GlobalManager.ts#L40">src/Utils/GlobalManager.ts:40</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>此GlobalManager启用时调用</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="schedule" class="tsd-anchor"></a>
<h3>schedule</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">schedule<span class="tsd-signature-symbol">(</span>timeInSeconds<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, repeats<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span>, context<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, onTime<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>timer<span class="tsd-signature-symbol">: </span><a href="../interfaces/_utils_timers_itimer_.es.itimer.html" class="tsd-signature-type">ITimer</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_utils_timers_timer_.es.timer.html" class="tsd-signature-type">Timer</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/esengine/egret-framework/blob/562bacb/source/src/Utils/Timers/TimerManager.ts#L24">src/Utils/Timers/TimerManager.ts:24</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>调度一个一次性或重复的计时器,该计时器将调用已传递的动作</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>timeInSeconds: <span class="tsd-signature-type">number</span></h5>
</li>
<li>
<h5>repeats: <span class="tsd-signature-type">boolean</span></h5>
</li>
<li>
<h5>context: <span class="tsd-signature-type">any</span></h5>
</li>
<li>
<h5>onTime: <span class="tsd-signature-symbol">(</span>timer<span class="tsd-signature-symbol">: </span><a href="../interfaces/_utils_timers_itimer_.es.itimer.html" class="tsd-signature-type">ITimer</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span></h5>
<div class="tsd-comment tsd-typography">
</div>
<ul class="tsd-parameters">
<li class="tsd-parameter-signature">
<ul class="tsd-signatures tsd-kind-type-literal">
<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>timer<span class="tsd-signature-symbol">: </span><a href="../interfaces/_utils_timers_itimer_.es.itimer.html" class="tsd-signature-type">ITimer</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>timer: <a href="../interfaces/_utils_timers_itimer_.es.itimer.html" class="tsd-signature-type">ITimer</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="_utils_timers_timer_.es.timer.html" class="tsd-signature-type">Timer</a></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a name="setenabled" class="tsd-anchor"></a>
<h3>set<wbr>Enabled</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<li class="tsd-signature tsd-kind-icon">set<wbr>Enabled<span class="tsd-signature-symbol">(</span>isEnabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<p>Inherited from <a href="_utils_globalmanager_.es.globalmanager.html">GlobalManager</a>.<a href="_utils_globalmanager_.es.globalmanager.html#setenabled">setEnabled</a></p>
<ul>
<li>Defined in <a href="https://github.com/esengine/egret-framework/blob/562bacb/source/src/Utils/GlobalManager.ts#L26">src/Utils/GlobalManager.ts:26</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>启用/禁用这个GlobalManager</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>isEnabled: <span class="tsd-signature-type">boolean</span></h5>
<div class="tsd-comment tsd-typography">
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-overwrite">
<a name="update" class="tsd-anchor"></a>
<h3>update</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-overwrite">
<li class="tsd-signature tsd-kind-icon">update<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<p>Overrides <a href="_utils_globalmanager_.es.globalmanager.html">GlobalManager</a>.<a href="_utils_globalmanager_.es.globalmanager.html#update">update</a></p>
<ul>
<li>Defined in <a href="https://github.com/esengine/egret-framework/blob/562bacb/source/src/Utils/Timers/TimerManager.ts#L8">src/Utils/Timers/TimerManager.ts:8</a></li>
</ul>
</aside>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class="globals ">
<a href="../globals.html"><em>Globals</em></a>
</li>
<li class="current tsd-kind-module">
<a href="../modules/_utils_timers_timermanager_.html">&quot;<wbr>Utils/<wbr>Timers/<wbr>Timer<wbr>Manager&quot;</a>
<ul>
<li class="current tsd-kind-namespace tsd-parent-kind-module">
<a href="../modules/_utils_timers_timermanager_.es.html">es</a>
</li>
</ul>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
</ul>
<ul class="current">
<li class="current tsd-kind-class tsd-parent-kind-namespace">
<a href="_utils_timers_timermanager_.es.timermanager.html" class="tsd-kind-icon">Timer<wbr>Manager</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
<a href="_utils_timers_timermanager_.es.timermanager.html#_enabled" class="tsd-kind-icon">_enabled</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="_utils_timers_timermanager_.es.timermanager.html#_timers" class="tsd-kind-icon">_timers</a>
</li>
<li class=" tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited">
<a href="_utils_timers_timermanager_.es.timermanager.html#enabled" class="tsd-kind-icon">enabled</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a href="_utils_timers_timermanager_.es.timermanager.html#ondisabled" class="tsd-kind-icon">on<wbr>Disabled</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a href="_utils_timers_timermanager_.es.timermanager.html#onenabled" class="tsd-kind-icon">on<wbr>Enabled</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="_utils_timers_timermanager_.es.timermanager.html#schedule" class="tsd-kind-icon">schedule</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
<a href="_utils_timers_timermanager_.es.timermanager.html#setenabled" class="tsd-kind-icon">set<wbr>Enabled</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-overwrite">
<a href="_utils_timers_timermanager_.es.timermanager.html#update" class="tsd-kind-icon">update</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
</ul>
</nav>
</div>
</div>
</div>
<footer class="with-border-bottom">
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-namespace"><span class="tsd-kind-icon">Namespace</span></li>
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
</ul>
</div>
</div>
</footer>
<div class="container tsd-generator">
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
</div>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
<script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script>
</body>
</html>