IEnumerator DimensionClickedTransition() { if (UIHandlerScript.delayStart_CMButton) { yield return(new WaitForSeconds(1f)); UIHandlerScript.delayStart_CMButton = false; } dimensionsRotate = true; Arrow_B.SetActive(true); Arrow_H.SetActive(true); Arrow_L.SetActive(true); }
// Update is called once per frame void Update() { if (resetRotation == true) { float angle = Mathf.MoveTowardsAngle(transform.eulerAngles.y, targetAngle, resetRotationSpeed * Time.deltaTime); transform.eulerAngles = new Vector3(0, angle, 0); // if(transform.eulerAngles.y == targetAngle) if (Mathf.Abs(transform.eulerAngles.y - targetAngle) < 1f) { transform.eulerAngles = new Vector3(0, targetAngle, 0); resetRotation = false; } } if (dimensionsRotate == true) { float angle = Mathf.MoveTowardsAngle(transform.eulerAngles.y, rotationAngle, resetRotationSpeed * Time.deltaTime); transform.eulerAngles = new Vector3(0, angle, 0); if (Mathf.Abs(transform.eulerAngles.y - rotationAngle) < 1f) { transform.eulerAngles = new Vector3(0, rotationAngle, 0); dimensionsRotate = false; } } if (dimensionClick == true && !(transform.eulerAngles.y % 360 >= 0f && transform.eulerAngles.y % 360 < 270f) && !UIHandlerScript.delayStart_CMButton) { Arrow_B.SetActive(true); Arrow_H.SetActive(true); Arrow_L.SetActive(true); } else if (dimensionClick == true && (transform.eulerAngles.y % 360 == 0f) && !UIHandlerScript.delayStart_CMButton) { Arrow_B.SetActive(false); Arrow_H.SetActive(true); Arrow_L.SetActive(true); } else if (dimensionClick == true && !UIHandlerScript.delayStart_CMButton) { Arrow_B.SetActive(false); Arrow_H.SetActive(false); Arrow_L.SetActive(false); } }
public void OnDimensionClicked() { dimensionClick = !dimensionClick; if (dimensionClick == true) { resetRotation = true; StartCoroutine(DimensionClickedTransition()); } else { Arrow_B.SetActive(false); Arrow_H.SetActive(false); Arrow_L.SetActive(false); resetRotation = true; } }
public void OnDimensionClicked() { dimensionClick = !dimensionClick; if (dimensionClick == true) { dimensionsRotate = true; } else { Arrow_B.SetActive(false); Arrow_H.SetActive(false); Arrow_L.SetActive(false); ArrowBack_B.SetActive(false); ArrowBack_H.SetActive(false); ArrowBack_L.SetActive(false); resetRotation = true; } }