void Awake() { Debug.Log("GameContoller Awake"); colorStack = new Stack <string>(); colorStack.Push("maroon"); colorStack.Push("lime"); colorStack.Push("magenta"); colorStack.Push("orange"); colorStack.Push("blue"); colorStack.Push("yellow"); colorStack.Push("cyan"); colorStack.Push("red"); grid = GameObject.Find("HexGrid").GetComponent <HexGrid>(); gameApp = GameObject.Find("GameApp").GetComponent <GameApp>(); levelLoader = GameObject.Find("LevelLoader").GetComponent <LevelLoader>(); turnScreen = GameObject.Find("Canvas").GetComponentInChildren <TurnScreen>(); // init it here, because they depends on GameController, which is started after MonoBehaviour scripts GameObject.Find("UpperPanel").GetComponent <UpperPanel>().Init(); GameObject.Find("SidePanel").GetComponent <SideMenu>().Init(); alliancePanel = GameObject.Find("AlliancePanel").GetComponent <AlliancePanel>(); alliancePanel.Init(); players = new List <GameObject>(); planets = new List <GameObject>(); stars = new List <GameObject>(); spaceships = new List <GameObject>(); currentPlayerIndex = 0; }
void Start() { speed = 0.1f; Rotation = 0; CanMove = true; PlayerController = GetComponent <CharacterController> (); Turning = GameObject.Find("Main Camera").gameObject.GetComponent <TurnScreen> (); }
/* * Called from clientNetworkManager, when the client should end game */ public void GameEnded(string msg) { Debug.Log("GameEnded"); if (turnScreen == null) { turnScreen = GameObject.Find("Canvas").GetComponentInChildren <TurnScreen>(); } turnScreen.Show("END\n" + msg); }
void Awake() { Debug.Log("GameContoller Awake"); grid = GameObject.Find("HexGrid").GetComponent <HexGrid>(); gameApp = GameObject.Find("GameApp").GetComponent <GameApp>(); levelLoader = GameObject.Find("LevelLoader").GetComponent <LevelLoader>(); turnScreen = GameObject.Find("Canvas").GetComponentInChildren <TurnScreen>(); // init it here, because they depends on GameController, which is started after MonoBehaviour scripts GameObject.Find("UpperPanel").GetComponent <UpperPanel>().Init(); GameObject.Find("SidePanel").GetComponent <SideMenu>().Init(); players = new List <GameObject>(); planets = new List <GameObject>(); stars = new List <GameObject>(); spaceships = new List <GameObject>(); currentPlayerIndex = 0; }