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"); } }
private void Update() { Vector2 resultant = finalPosition - initialPosition; gameObject.transform.position = resultant * (gaugeFillScript.GetFillAmount() / gaugeLockScript.GetGaugeLock()); }
private void Update() { float difference = finalRotation - initialRotation; gameObject.transform.rotation = Quaternion.Euler(0, 0, (gaugeFillScript.GetFillAmount() / gaugeLockScript.GetGaugeLock()) * difference); }