//initialise a campaign game where the player needs to complete mission(s) private void InitCampaignGame() { MissionMgr = FindObjectOfType(typeof(MissionManager)) as MissionManager; ScenarioLoader scenarioLoader = FindObjectOfType(typeof(ScenarioLoader)) as ScenarioLoader; if (MissionMgr) //if there's a mission manager in this current map { MissionMgr.Init(this, scenarioLoader != null ? scenarioLoader.LoadedSceneario : null); //initiailise it } if (scenarioLoader != null) //destroy the scenario loader as it is no longer needed { Destroy(scenarioLoader.gameObject); } }
public void Init(ScenarioLoader manager, int index) { this.manager = manager; ID = index; }