Beispiel #1
0
    public void SlowUp(Vector2 obj)
    {
        if (_routineSpeedup != null)
        {
            return;
        }
        if (_routineSlow != null)
        {
            _routineSlow = null;
        }

        _routineSpeedup = HelperTween.TimeScaleEnum(Time.timeScale, 1f, 0.15f, AnimationCurve.EaseInOut(0f, 0f, 1f, 1f), true);
    }
Beispiel #2
0
    private IEnumerator FireSlowMo()
    {
        Time.timeScale = 0f;
        //Move & scale
        StartCoroutine(HelperTween.MoveTransformEnum(TargetShoot.transform, TargetShoot.transform.position, _trans.position,
                                                     0.3f, AnimationCurve.EaseInOut(0f, 0f, 1f, 1f)));
        yield return(HelperTween.ScaleEnum(TargetShoot.transform, TargetShoot.transform.localScale, Vector3.zero, 0.3f, AnimationCurve.EaseInOut(0f, 0f, 1f, 1f)));

        TargetShoot.transform.position   = _trans.position;
        TargetShoot.PawnRigid2D.velocity = Vector2.zero;

        if (OnShootPawn != null)
        {
            OnShootPawn();
        }
        TargetShoot.PawnRigid2D.AddForce(_aimDir * ShootForce, ForceMode2D.Impulse);
        StartCoroutine(HelperTween.ScaleEnum(TargetShoot.transform, TargetShoot.transform.localScale, Vector3.one, 0.2f,
                                             AnimationCurve.EaseInOut(0f, 0f, 1f, 1f)));
        yield return(HelperTween.TimeScaleEnum(0f, 1f, 0.3f, AnimationCurve.EaseInOut(0f, 0f, 1f, 1f)));
        //Move & scale and timescale
    }