//================================================================================ // Unity //================================================================================ void Start() { // Set singleton instance lobbyManagerSingleton = this; // Keep Lobby-Scene on Scene change DontDestroyOnLoad(gameObject); currentPanel = mainPanel; lobbyHook = GetComponent <PlayerLobbyHook>(); }
/// <summary> /// Start the game as soon as the initial unit is created. /// </summary> public void StartTheGame() { PlayerState.Get(playerControllerId).Population = 1; if (!IsHuman) { AIPlayer aiPlayer = factory.CreateAIPlayer(); SimpleAI AI = factory.CreateAI(); aiPlayer.playerState = PlayerState.Get(playerControllerId); aiPlayer.gameState = GameState.Instance; AI.aiPlayer = aiPlayer; } else { endGameCanvas = GameObject.Find("EndGameCanvas"); CustomLobbyManager manager = FindObjectOfType <CustomLobbyManager>(); endGameCanvas.transform.Find("MenuButton").GetComponent <Button>().onClick.AddListener(manager.GoBack); endGameCanvas.SetActive(false); } CmdChangeInGame(true); }
void Start() { _instance = this; CustomMessage.registerServerHandler<ClientStartGame>(onClientStartGame); }
void Start() { _instance = this; CustomMessage.registerServerHandler <ClientStartGame>(onClientStartGame); }
void Start() { Instance = this; }
public GameObject ChatMessagePrefab; //Reference to prefab for instantiating chat messages void Start() { Instance = this; }
private void Awake() { lobbyManager = FindObjectOfType <CustomLobbyManager>(); }