Beispiel #1
0
        public override void Update(float deltaTime)
        {
            base.Update(deltaTime);

            if (Vector2.Distance(_transform.position, _orbIdlePositionTransform.position) <= _radiusToGoIdle)
            {
                _orbController.SetState(OrbController.OnPlayerState);
                GameManager.Orb.SoundsPlayer.Play("Returning");
            }
        }
        public override void FixedUpdate(float deltaTime)
        {
            base.FixedUpdate(deltaTime);

            _rigidbody.velocity *= _directionalAttackDecelerationFactor * (SaveSystem.currentMaskType == PlayerMaskController.MaskType.ScarletMask ? 0.9f : 1);

            if (_rigidbody.velocity.magnitude <= _directionalAttackMinVelocityToChangeState)
            {
                _orbController.SetState(OrbController.ReturningState);
            }
        }