Beispiel #1
0
    /// <summary>
    /// Sets the timer For Bar Progress
    /// this method will set and reset the timer on clearing row and column
    /// </summary>
    /// <param name="timerToIncrease">Timer to increase.</param>
    public void SetTimer(int timerToIncrease = 0)
    {
        if (GamePlayMode == GameMode.timer)
        {
            EGTween.Stop(gameObject);
            TimerValue = TimerValue + timerToIncrease;
            TimerValue = Mathf.Clamp(TimerValue, 0, TotalTimerValue);

            float currentBarProgress = ((float)TimerValue / (float)TotalTimerValue) * 100F;

            float barFillValue = (555.0F / (100 / currentBarProgress));
            Timer.sizeDelta = new Vector2(barFillValue, Timer.sizeDelta.y);
            EGTween.ValueTo(gameObject, EGTween.Hash("from", (float)Timer.sizeDelta.x, "to", 0.0f, "time", TimerValue, "onUpdate", "BarProgress", "onComplete", "OnBarCompelete", "onCompleteTarget", gameObject));
        }
    }
Beispiel #2
0
 public static void ValueTo(this GameObject target, Hashtable args)
 {
     EGTween.ValueTo(target, args);
 }