public void SetMission(Mission mission) { mission.SetActive(); this.priority = mission.GetPriority(); this.mission = mission; mission.AddMissionListener(this); SetText(mission.GetProgressRepresentation()); }
//Корректное создание миссии //Только так она создастся правильно protected Mission InstantiateMission(Mission missionPrefab) { string id = (string)prefabKeyDictionary [missionPrefab]; Mission mission = (Instantiate(missionPrefab) as Mission); mission.singleTransform.parent = singleTransform; mission.AddMissionListener(this); mission.SetId(id); mission.SetPriority(GetPriority()); if (GlobalOptions.gameState == GameStates.GAME) { GlobalOptions.GetGuiLayer().AddMission(mission); //notify } return(mission); }
public override void SetMission(Mission mission) { base.SetMission(mission); mission.AddMissionListener(this); }