Example #1
0
    void Init()
    {
        for (int i = 0; i < POOL_SIZE; i++)
        {
            GameObject obj = Instantiate(EnemyCreate.Instance().disk);
            obj.SetActive(false);
            diskPool[i] = obj;

            diskPool[i].GetComponent <Disk>().poolIndex = i;
            if (i == 0)
            {
                continue;
            }
            diskPool[i - 1].GetComponent <Disk>().nextDisk = diskPool[i];
        }
        diskPool[POOL_SIZE - 1].GetComponent <Disk>().nextDisk = null;
        firstAvailable = diskPool[0];
    }
Example #2
0
 void OnGUI()
 {
     GUI.Label(new Rect(10, 10, 100, 20), "Round:" + (EnemyCreate.Instance().GetRoundIndex() + 1));
 }