public override void _Process(float delta) { base._Process(delta); if (IsFrozen) { Idle.Stop(); } else { Idle.Play(); } if (!IsFrozen) { if (IsOnWall()) { _direction = GetRandomDirection(); } _changeDirection -= delta; if (_changeDirection <= 0) { RandomizeDirection(); } } }
void OnIdleTickCallback(Idle handle) { this.ticks++; if (this.ticks >= NumberOfTicks) { handle.Stop(); } }
void NextTick(Idle handle) { handle.Stop(); this.idle = this.loop.CreateIdle(); this.idle.Start(this.OnIdle); this.timer = this.loop.CreateTimer(); this.timer.Start(this.OnTimer, 0, 0); }
void IdleCallback(Idle handle) { this.idleCallbackCheck = (this.idleCalled == 0 && this.timerCalled == 1); if (handle != null && handle == this.idle) { handle.Stop(); this.idleCalled++; } }
void IdleCallback(Idle handle) { if (handle != null) { this.idleCounter++; if (this.idleCounter == NumberOfTicks) { handle.Stop(); } } }
void NextTick(Idle handle) { if (handle != null) { handle.Stop(); this.idle = this.loop.CreateIdle(); this.idle.Start(this.IdleCallback); this.timer = this.loop.CreateTimer(); this.timer.Start(this.TimerCallback, 0, 0); } }
void OnIdle1(Idle handle) { /* Init idle 2 and make it active */ if (this.idle2 == null || !this.idle2.IsActive) { this.idle2 = this.loop.CreateIdle(); this.idle2.Start(this.OnIdle2); this.idle2Started++; } this.idle1Called++; if (this.idle1Called % 5 == 0) { handle.Stop(); this.idles1Active--; } }
void OnIdle(Idle handle) { this.idleCallbackCheck = (this.idleCalled == 0 && this.timerCalled == 1); handle.Stop(); this.idleCalled++; }