Exemplo n.º 1
0
 public void OnMissionUpdate(Mission mission)
 {
     if (mission.Complete)
     {
         active.Remove(mission);
         _gameProgress++;
         audioSource.clip = completeClip;
         audioSource.Play();
         var m = _unlocked.Find(e => e.GetComponent <MissionUI>().mission == mission);
         _unlocked.Remove(m);
         Destroy(m);
         if (_gameProgress == missions.Length)
         {
             UIController.Instance.Victory();
         }
         UpdateUnlocked();
     }
     else
     {
         active.Add(mission);
         var missionUi = Instantiate(missionPrefab, missionWindow).GetComponent <MissionUI>();
         missionUi.mission = mission;
         _unlocked.Add(missionUi.gameObject);
     }
     MapUI.UpdateTasks();
     _waitingForUiShow.Enqueue(mission);
 }