//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! }
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(); } } } }
private void Start() { manager = LocalGameManager.Instance; }
public SinglePlayerGamePlayScreen(Game game, GameStateManager manager) : base(game, manager) { _gameManager = new LocalGameManager(); }
void Start() { localGameManager = GameObject.Find ("LocalGameManager").GetComponent<LocalGameManager> (); setupSprites (); }