bool debug = false; //Whether the debug screen is running or not // Use this for initialization void Awake () { /* Created to: https://unity3d.com/learn/tutorials/projects/2d-roguelike-tutorial/writing-game-manager?playlist=17150 * If an instance of the game manager has not been created * created one and if the instance is not the current one then * destroy that gameobject. */ if (instance == null) { instance = this; } else if(instance != this){ Destroy (gameObject); } DontDestroyOnLoad (gameObject); //Gets the components attached to the gameobject to initialise all the managers roomScript = GetComponent<RoomManager> (); roomData = GetComponent<LoadXmlData> (); scoreManager = GetComponent<ScoreManager> (); //Loads in room data from XML roomData.loadRooms (); //Loads all player data from XML roomData.loadPlayerProfiles (); //Sets constant of number of rooms in the game numberOfRooms = roomData.getNumberOfRooms (); numberOfBossRooms = roomData.getNumberOfBossRooms (); numberOfSpecialRooms = roomData.getNumberOfSpecialRooms (); //Set the starting state of the game to the Main Menu GameManager.instance.changeState (GameStates.MainMenu); //Set the gui font and colour guiStyle.fontSize = 30; guiStyle.normal.textColor = Color.white; }
protected void ButtonAddXmlData_Click(object sender, EventArgs e) { //getting xml - Tour de France var loadCyclists = new LoadXmlData(); string filePathXml = HttpContext.Current.Server.MapPath("~/Common/DataToImport/France2.xml"); var franceTour = new List <TourData>(); loadCyclists.GetListOfWinner(XmlReader.Create(filePathXml), franceTour); Response.Redirect("Cyclists.aspx"); }
void InitGame() { if (gameAsset == null) { return; } // if (voiceover == null) return; if (video == null) { return; } Debug.Log("Load data. Init game"); LoadXmlData loader = new LoadXmlData(); loader.GetTranscript(ref gameAsset, ref transcript); loader.GetNegWords(ref libAsset, ref negWords); // SoundManager.Instance.PlayVO(ref voiceover, ref transcript); VideoManager.Instance.PlayVO(ref video, ref transcript); PlayerController.Instance.StartWalking(); }