Пример #1
0
    private void Awake()
    {
        if (instance == null)
            instance = this;

        else if (instance != this)
        {
            Debug.LogError("Tried to created another instance of " + GetType() + ". Destroying.");
            Destroy(gameObject);
        }
    }
Пример #2
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        else if (instance != this)
        {
            Debug.LogError("Tried to create another instance of " + GetType() + ". Destroying.");
            Destroy(gameObject);
        }
    }
Пример #3
0
    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;
    }
Пример #4
0
    public CustomerSpawner(List<Building> buildings)
    {
        worldTimeController = WorldTimeController.instance;

        BuildTrackersList(buildings);
    }
Пример #5
0
 // Use this for initialization
 private void Start()
 {
     worldController = FindObjectOfType<WorldController>();
     worldTimeController = FindObjectOfType<WorldTimeController>();
 }
Пример #6
0
 public NeutralBuilding()
 {
     worldTimeController = WorldTimeController.instance;
 }
 private void Start()
 {
     AudioSource = GetComponent<AudioSource>();
     worldTimeController = FindObjectOfType<WorldTimeController>();
 }