예제 #1
0
    /// <summary>
    /// Apply a Slow effect to the target
    /// </summary>
    /// <param name="target">target GameObject.</param>
    /// <param name="duration">length time.</param>
    /// <param name="decimalSlow">0 - 1 where 1 is base.</param>
    public void slowApplyingSystem(GameObject target, float duration, float decimalSlow)
    {
        Slow slow = null;

        slow = target.GetComponent <Slow>();

        if (slow == null)
        {
            slow = target.AddComponent <Slow>();
        }
        else
        {
            slow.stopSlow();
        }

        slow.setSlowPercent(decimalSlow);
        slow.setDuration(duration);

        slow.startSlow();
    }