Esempio n. 1
0
        public virtual void OnFailed()
        {
            if (failLogic == null)
            {
                if (objectiveFailedEventText != null && objectiveFailedEventText.Text != "")
                {
                    if (eventTextCanvas.Equals(EventTextCanvas.BaseState))
                    {
                        mission.MissionHelper.ShowEvent(objectiveFailedEventText);
                    }
                    else if (eventTextCanvas.Equals(EventTextCanvas.MessageBox))
                    {
                        PopupHandler.DisplayMessage(objectiveFailedEventText.Text);
                    }
                }

                MissionManager.MarkMissionAsFailed(mission.MissionID);
                mission.CurrentObjective = null;
            }
            else
            {
                failLogic.Invoke();
            }

            mission.OnFailed();

            if (mission.IsRestartAfterFail())
            {
                MissionManager.ResetMission(mission.MissionID);
            }
        }