// Update is called once per frame void Update() { var controller = alien.GetComponent <AlienController>(); if (!controller.CharacterMoving() && !_keying && !_beaming && !_beamed) { controller.SetIsKeying(true); controller.SetIsBeaming(false); _keying = true; _beaming = false; } else if (!controller.CharacterMoving() && _beaming & !_beamed) { controller.SetIsKeying(false); controller.SetIsBeaming(true); _keying = false; _beaming = true; PlayAnimation(); } else if (!controller.CharacterMoving() && _beamed) { // _beamed = true; PauseAnimationEnd(); } else if (controller.CharacterMoving() && _keying) { controller.SetIsKeying(false); controller.SetIsBeaming(false); _keying = false; _beaming = false; } else if (controller.CharacterMoving() && _beaming) { timer.ResetTimer(); ReverseAnimation(); controller.SetIsBeaming(false); controller.SetIsKeying(false); _keying = false; _beaming = false; } else if ((controller.IsNudged || controller.IsMovingHorizontally || controller.IsOnFloor == false) && _beaming) { timer.ResetTimer(); // Debug.Log("ShouldReverse"); ReverseAnimation(); } // else if (controller.IsMovingHorizontally) // { // timer.ResetTimer(); // Debug.Log("ShouldReverse"); // ReverseAnimation(); // } }
// Update is called once per frame void Update() { _timer.IncrementTimer(Time.deltaTime); if (_timer.CheckTimer()) { UnstickBall(); _timer.ResetTimer(); } }
private void SetCatIdle(bool catIdle) { if (catIdle) { IsIdle = true; _idleTimer.SetTimer(idleTime); _idleTimer.ResetAndStartTimer(); } else { IsIdle = false; _idleTimer.ResetTimer(); } }