// Initialization void Start() { // Set the turnLenght turnLenght = 18; // Set the first turn to true firstTurn = true; // Populate the game objects for cosmonauts and maraptors Cosmonauts.AddRange(GameObject.FindGameObjectsWithTag("Cosmonaut")); Maraptors.AddRange(GameObject.FindGameObjectsWithTag("Maraptor")); // Populate the State Machines for cosmonauts and maraptors, editing their names and startup properites foreach (GameObject Cosmonaut in Cosmonauts) { cosmonautP = Cosmonaut.GetComponent <cosmonautBase> (); cosmonautP.name = Cosmonaut.transform.gameObject.name; cosmonautP.baseHP = 100; cosmonautP.currentHP = 100; cosmonautP.baseShield = 50; CosmonautStateMachines.Add(Cosmonaut.GetComponent <cosmonautStateMachine> ()); } foreach (GameObject Maraptor in Maraptors) { maraptorP = Maraptor.GetComponent <maraptorBase> (); maraptorP.name = Maraptor.transform.gameObject.name; maraptorP.baseHP = 100; maraptorP.currentHP = 100; maraptorP.baseShield = 50; MaraptorStateMachines.Add(Maraptor.GetComponent <maraptorStateMachine> ()); } // Get the numberOfCosmonauts and numberOfMaraptors numberOfCosmonauts = Cosmonauts.Count; numberOfMaraptors = Maraptors.Count; // Set the number of player characters and the number of played on characters numberOfPlayerCharacters = numberOfCosmonauts + numberOfMaraptors; numberOfPlayedOnCharacters = 0; // Get the MainCameraPlayer MainCameraPlayer = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <cameraFollowPlayer> ();; // Get the Action Menu AM = GameObject.Find("ActionMenu").GetComponent <actionMenuScript>(); // Start Game GameState = GameStateEnum.INTRO; turnTimer = 0; StartCoroutine("TurnTimerIncrementor"); }
void Start() { gameOver = false; GSM = GameObject.Find("GameManager").GetComponent <GameStateMachine>(); AM = GameObject.Find("ActionMenu").GetComponent <actionMenuScript>(); }