Example #1
0
    public override void OnStateExit()
    {
        _fallEndY = _transform.position.y;
        float dY            = Mathf.Abs(_fallStartY - _fallEndY);
        float fallIntensity = Mathf.InverseLerp(0, _maxFallDistance, dY);

        if (Time.time >= t + _coolDown)
        {
            _dustController.PlayLandParticles(fallIntensity);
            t = Time.time;
        }
    }
Example #2
0
 public override void OnStateEnter()
 {
     _dustController.PlayLandParticles(1f);         //Same particles as the landing, but with full power
 }