private IEnumerator Rotate(float valueZ) { transform.DORotate(new Vector3(0, 0, valueZ), sequence.movingDelay, RotateMode.Fast); yield return(new WaitForSeconds(sequence.movingDelay)); SequenceActivated?.Invoke(true); }
public void DoRotate(bool activated) { if (activated && buttonsOffset != 0) { int range = UnityEngine.Random.Range(0, 2); switch (range) { case 0: StartCoroutine(Rotate(buttonsSpawner.angleRotation * buttonsOffset)); break; case 1: StartCoroutine(Rotate(-buttonsSpawner.angleRotation * buttonsOffset)); break; } } else { SequenceActivated?.Invoke(true); } }