private IEnumerator WaitForSpacialItemGoToPacient(SpecialCompleteItem specialCompleteItem) { while (specialCompleteItem.specialItemObject.activeSelf) { yield return(null); } OpenVictoryCanvas(); }
protected override void ExecuteAction(CharacterBehaviour character) { if (character.CheckIfSpecialIsActivated() && !specialItemIsUsed) { specialItemIsUsed = true; GameEvents.FSMEvents.StartInteraction.SafeInvoke(GameEnums.FSMInteractionEnum.ActivateItem); // wait form reach destination SpecialCompleteItem specialCompleteItem = character.specialCompleteItem.GetComponent <SpecialCompleteItem>(); specialCompleteItem.GetComponent <Animator>().SetTrigger("GoToPatient"); StartCoroutine(WaitForSpacialItemGoToPacient(specialCompleteItem)); } }
private IEnumerator WaitForSpacialItemGoToPacient(SpecialCompleteItem specialCompleteItem) { while (specialCompleteItem.specialItemObject.activeSelf) { yield return(null); } // register finish tutorial on save file if (SaveManager.currentProgress != null) { SaveManager.currentProgress.completedTutorial = true; SaveManager.SaveProgressFile(); } GameEvents.AudioEvents.TriggerSFX.SafeInvoke("Fanfare", false, false); SceneChanger.Instance.ChangeToScene("hospital"); }