//================================================================================
    // Unity
    //================================================================================

    void Start()
    {
        // Set singleton instance
        lobbyManagerSingleton = this;
        // Keep Lobby-Scene on Scene change
        DontDestroyOnLoad(gameObject);
        currentPanel = mainPanel;
        lobbyHook    = GetComponent <PlayerLobbyHook>();
    }
示例#2
0
 /// <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);
 }
示例#3
0
 void Start()
 {
     _instance = this;
     CustomMessage.registerServerHandler<ClientStartGame>(onClientStartGame);
 }
 void Start()
 {
     _instance = this;
     CustomMessage.registerServerHandler <ClientStartGame>(onClientStartGame);
 }
示例#5
0
 void Start()
 {
     Instance = this;
 }
示例#6
0
    public GameObject ChatMessagePrefab;            //Reference to prefab for instantiating chat messages

    void Start()
    {
        Instance = this;
    }
示例#7
0
 private void Awake()
 {
     lobbyManager = FindObjectOfType <CustomLobbyManager>();
 }