void OnGUI() { GUI.Label(new Rect(50, 50, 100, 20), "Round:" + (MainCreate.Instance().GetRoundIndex() + 1)); GUI.Button(new Rect(20, 80, 100, 40), "Begin"); GUI.Button(new Rect(20, 130, 100, 40), "Restart"); if (GUI.Button(new Rect(20, 130, 100, 40), "Restart")) { Application.LoadLevel(Application.loadedLevelName); } }
void Init() { for (int i = 0; i < POOL_SIZE; i++) { if (i == 0) { GameObject obj = Instantiate(MainCreate.Instance().disk); obj.SetActive(false); diskPool[i] = obj; else { 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]; }