//start the local game logic
    //if find a network manager, wait for all players to load in to then initialize multiplayer logic
    //otherwise, setup players
    void Start()
    {
        Debug.Log("GameManager began.");

        SingletonGameManager = this;

        InitializeCardDatabase();
        InitializeHardCodedLibrary();

        uiManager.gameManager = this;

        //if game is not multiplayer, spawn players and begin the UI
        if (!GameObject.FindObjectOfType <NetworkManager>())
        {
            StartCoroutine("InitializeGameAfterSmallTime");
        }
        //otherwise, do nothing!
    }
Ejemplo n.º 2
0
    public IEnumerator StartPopgeneration()
    {
        LocalGameManager manager = GameObject.FindGameObjectWithTag("Manager").GetComponent <LocalGameManager>();

        while (currentAmount < capacity)
        {
            yield return(new WaitForSeconds(generationDelay));

            if (currentAmount < capacity)
            {
                if (manager.food >= foodConsumption)
                {
                    currentAmount      += 1;
                    manager.population += 1;
                    manager.food       -= foodConsumption;
                    manager.RecalculatePopulationBoost();
                }
            }
        }
    }
Ejemplo n.º 3
0
 private void Start()
 {
     manager = LocalGameManager.Instance;
 }
Ejemplo n.º 4
0
 public SinglePlayerGamePlayScreen(Game game, GameStateManager manager)
     : base(game, manager)
 {
     _gameManager = new LocalGameManager();
 }
Ejemplo n.º 5
0
 void Start()
 {
     localGameManager = GameObject.Find ("LocalGameManager").GetComponent<LocalGameManager> ();
     setupSprites ();
 }