Beispiel #1
0
        private void UpdateRotation()
        {
            // broken
            if (_Main._Settings._Broken)
            {
                _Speed = Mathf.Lerp(_Speed, 0.0f, 0.2f);

                if (_Speed < 0.01f)
                {
                    _Speed = 0.0f;
                }

                _Rotation += _Speed;
            }
            // not broken
            else
            {
                if (!_Main.CheckPause())
                {
                    switch (_RotationDirection)
                    {
                    case RotorRotationDirection.COUNTER_CLOCKWISE:
                        _Speed = Mathf.Lerp(_Speed, +_Settings._RotorSpeed_Aesthetic, _Settings._RotorSpeedTransition_Aesthetic);
                        break;

                    case RotorRotationDirection.CLOCKWISE:
                        _Speed = Mathf.Lerp(_Speed, -_Settings._RotorSpeed_Aesthetic, _Settings._RotorSpeedTransition_Aesthetic);
                        break;

                    case RotorRotationDirection.NULL:
                        _Speed = Mathf.Lerp(_Speed, 0.0f, _Settings._RotorSpeedTransition_Aesthetic);
                        break;
                    }

                    _Rotation += (_Speed * _Main._Settings._GlobalSpeedModifier);
                    //
                    // _SpeedRatio = Mathf.Clamp01(Mathf.Abs(_Speed) / _Settings._RotorRotationSpeed);
                }
            }
        }