private void Awake() { if (instance == null) instance = this; else if (instance != this) { Debug.LogError("Tried to created another instance of " + GetType() + ". Destroying."); Destroy(gameObject); } }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Debug.LogError("Tried to create another instance of " + GetType() + ". Destroying."); Destroy(gameObject); } }
private void Start() { Player player = new Player("ShrubNub"); world = new World(player); tileContainer = new GameObject("TileContainer"); buildingContainer = new GameObject("BuildingContainer"); customerContainer = new GameObject("CustomerContainer"); worldTimeController = FindObjectOfType<WorldTimeController>(); AdjustGround(); SpawnTiles(); SpawnBuildings(); normalCustomerObjectPool = new ObjectPool(normalCustomerPrefab, 300, customerContainer); StartCoroutine("CustomerSpawnerRutine"); Time.timeScale = 1.0f; }
public CustomerSpawner(List<Building> buildings) { worldTimeController = WorldTimeController.instance; BuildTrackersList(buildings); }
// Use this for initialization private void Start() { worldController = FindObjectOfType<WorldController>(); worldTimeController = FindObjectOfType<WorldTimeController>(); }
public NeutralBuilding() { worldTimeController = WorldTimeController.instance; }
private void Start() { AudioSource = GetComponent<AudioSource>(); worldTimeController = FindObjectOfType<WorldTimeController>(); }