Esempio n. 1
0
    private void LeftButtonClick()
    {
        float fillAmount = gaugeFillScript.GetFillAmount();

        if (fillAmount > 0f)
        {
            gaugeFillScript.SetFillAmount(fillAmount - gaugeFillSpeed);
        }
    }
 private void Update()
 {
     //mathf.approximately is used because the float values tend to differ slightly for some reason.
     if (Mathf.Approximately(gaugeFillScript.GetFillAmount(), gaugeAmountLock))
     {
         Debug.Log("Correct value");
     }
 }
Esempio n. 3
0
    private void Update()
    {
        Vector2 resultant = finalPosition - initialPosition;

        gameObject.transform.position = resultant * (gaugeFillScript.GetFillAmount() / gaugeLockScript.GetGaugeLock());
    }
Esempio n. 4
0
    private void Update()
    {
        float difference = finalRotation - initialRotation;

        gameObject.transform.rotation = Quaternion.Euler(0, 0, (gaugeFillScript.GetFillAmount() / gaugeLockScript.GetGaugeLock()) * difference);
    }