/* * Creates the level from xml template. And places character in level. **/ public void Play(GameplayManager.GameplayType gameplayType) { gpMgr.gameplayType = gameplayType; //To load xml string from given file name: string filePath = "./Configurations/xml\\" + sceneFileName; string configText = System.IO.File.ReadAllText(filePath); //To load xml file into EnvironmentManager object, call (passing in the xml as a string): //envMgr.LoadConfigXml(configText); //envMgr.LoadConfiguration (); gameManagers.SendMessage("LoadConfiguration", configText); //To create the DataContainer from the EnvironmentManager, call: envMgr.StartCreateEnvironment(); //Placing character in level: GameplayManager gameplayManager = gameManagers.GetComponent <GameplayManager> (); gameplayManager.InitializeCharacter(0); //Call this to create the target stack: DataContainer.Instance.UnloadLevelData(); gameplayManager.OnEnvironmentReady(1); GameObject.Find("MainMenuCanvas").SetActive(false); }
public void StopTracking() { gameplay = GameObject.FindGameObjectWithTag("GameManagers").GetComponent <GameplayManager>().Gameplay; if (currentFilePath.Length > 0) { SaveLog(currentFilePath); } currentFilePath = string.Empty; }
void OnEnvironmentReady(int level) { EnvironmentManager env = GameObject.FindGameObjectWithTag("GameManagers").GetComponent <EnvironmentManager>(); intersectionPos.Clear(); for (int i = 0; i < env.Crosses.Count; i++) { intersectionPos.Add(env.Crosses[i].position); } gameplay = GameplayManager.GameplayType.Navigation; }