public void OnMouseDown() { //Rotate the cube and call the cube turned event. rotating = true; GetComponent <AudioSource> ().Play(); StartCoroutine(OverTime.Rotate(transform, new Vector3(-90, 0, 0), rotationDuration, AfterRotate)); }
private void OnMouseDown() { if (rotating) { return; } rotating = true; GetComponent <AudioSource> ().Play(); StartCoroutine(OverTime.Rotate(transform, new Vector3(0, 360 / statesOfRotation, 0), rotationDuration, UpdateRotation)); }