Ejemplo n.º 1
0
    public void SlowDownAnimation(float speed_down, float speed_up, float speed_Min, float speed_min_time, float speedMinLastTime, float dumpReduce)
    {
        if (_speedDownFlag && _inState && dumpReduce < 0.01f)
        {
            return;
        }
        else
        {
            _speedOrg    = _owner.AniGetAnimationOrgSpeed();
            _curSpeedMax = _speedOrg * _speedUpScale;
            if (speed_up > 999)
            {
                _curSpeedMax = _curSpeedMax * 1.2f;
            }
            if (!_speedDownFlag && _inState)
            {
                float upPercents = _curSpeed / _curSpeedMax;
                if (upPercents > 0.9f)
                {
                }
                else if (upPercents > (0.6f * dumpReduce))
                {
                    speed_min_time   = (_curSpeed / _curSpeedMax) * speed_min_time;
                    speedMinLastTime = (_curSpeed / _curSpeedMax) * speed_min_time;
                }
                else
                {
                    return;
                }
            }
            _speedDownFlag = true;
            _speedDown     = speed_down;
            _speedUp       = speed_up;
            _speedMin      = speed_Min;

            _speedMinTime = speed_min_time;

            _curSpeed         = _speedOrg;
            _speedMinLastTime = speedMinLastTime;
            if (!_inState)
            {
                StartCoroutine(STATE());
            }
        }
    }