private IEnumerator SwitchHandlerCoroutine(CompSwitch compSwitch, CompSwitchLabel label) { cman.BeginCutScene(); yield return StartCoroutine(compSwitch.animation.WaitForFinished()); Vector3 targetBackup = cman.target.position; GameObject door = null; switch (label) { case CompSwitchLabel.ONE: door = doors[0]; break; case CompSwitchLabel.TWO: door = doors[1]; break; case CompSwitchLabel.THREE: door = doors[2]; break; } currentSetNumber++; yield return StartCoroutine(cman.moveCamera(door .transform .position .toVector2XZ() .toVector3XZ() , CutSceneManager.SHORT_DELAY)); sem.PlaySoundEffect(11); Destroy(door); yield return new WaitForSeconds(CutSceneManager.SHORT_DELAY); yield return StartCoroutine(cman.moveCamera(iceRinkCenter.toVector3XZ(), CutSceneManager.SHORT_DELAY)); yield return StartCoroutine(ClearObstacles()); yield return StartCoroutine(InitializeObstacles()); yield return new WaitForSeconds(CutSceneManager.SHORT_DELAY); yield return StartCoroutine(cman.moveCamera(targetBackup, CutSceneManager.SHORT_DELAY)); cman.EndCutScene(); }
private void SwitchHandler(CompSwitch cs, CompSwitchLabel cwl) { StartCoroutine(SwitchHandlerCoroutine(cs, cwl)); }