private void AdventureController_OnAdventureOver(AdventureResult result)
 {
     Statistics = result.ToString();
     SceneChanger.LoadSpecificSceneAsync("StatisticsScene");
     Destroy(AdventureController.Instance.Hero.gameObject);
     Destroy(AdventureController.Instance.gameObject);
     AdventureController.Instance = null;
 }
 private void AdventureController_OnAdventureOver(AdventureResult result)
 {
     AdventureController.Instance = null;
 }
 public void Compartment_OnOver(AdventureResult result)
 {
     if (this.OnAdventureOver != null) this.OnAdventureOver(result);
 }
Exemple #4
0
 public virtual void Initialize()
 {
     this.transform.position = new Vector3(this.transform.position.x, Constants.HeroYpos, 0);
     hPcurrent = HPBars;
     Inventory = new AbItem[Constants.InventorySize];
     Equipment = new AbEquipment[Enum.GetNames(typeof(EquipmentTypes)).Length];
     Animator = this.gameObject.GetComponent<Animator>();
     AudioPlayer = this.gameObject.GetComponent<AudioController>();
     Statistics = new AdventureResult();
 }
 public void OnOverEvent(AdventureResult advRes)
 {
     if (!isCoroutineClose)
     {
         OnOver(advRes);
     }
 }
 public IEnumerator OnOverCoroutine(AdventureResult advRes)
 {
     isCoroutineClose = true;
     yield return new WaitForSeconds(2f);
     isCoroutineClose = false;
     OnOverEvent(advRes);
     isCoroutineClose = true;
 }
 public void Compartment_OnOver(AdventureResult result)
 {
     foreach (var item in Hero.Inventory)
     {
         if (item != null)
             Destroy(item.gameObject);
     }
     foreach (var item in Hero.Equipment)
     {
         Destroy(item.gameObject);
     }
     AudioManager.Instance.SetMenu();
     if (PassageSceneController.Instance != null) Destroy(PassageSceneController.Instance.gameObject);
     if (RoomSceneController.Instance != null) Destroy(RoomSceneController.Instance.gameObject);
     if (this.OnAdventureOver != null) this.OnAdventureOver(result);
 }