public void clickedUndoInstantBuy() { UndoPowerUp un = new UndoPowerUp(); //List<PowerUpBase> playerPowerUps = listPowerUp1.GetActivePowerUps(); //playerPowerUps.Add(un); //listPowerUp1.Init(playerPowerUps); listPowerUp1.Add(un); initializePowerUp(); }
public void selectPowerUp() { string powerText = EventSystem.current.currentSelectedGameObject.name; int ind; Debug.Log(powerText); Text tempText; List <PowerUpBase> tempList; if (selectTurn == 1) { tempText = listA; tempList = pListA; ind = 0; arrowA.gameObject.SetActive(false); arrowB.gameObject.SetActive(true); } else { tempText = listB; tempList = pListB; ind = 1; arrowA.gameObject.SetActive(true); arrowB.gameObject.SetActive(false); } if (powerText.Contains("undo")) { // Debug.Log("Undo"); tempText.GetComponentInChildren <Text>().text += "\n> Undo"; UndoPowerUp un = new UndoPowerUp(); tempList.Add(un); // disablePUs[ind, 1] = 1; } else if (powerText.Contains("none")) { Debug.Log("None"); tempText.GetComponentInChildren <Text>().text += "\n> None"; // disablePUs[ind, 0] = 1; } else if (powerText.Contains("swap")) { // Debug.Log("Swap"); tempText.GetComponentInChildren <Text>().text += "\n> Swap"; SwapPowerUp sw = new SwapPowerUp(); tempList.Add(sw); // disablePUs[ind, 2] = 1; } else if (powerText.Contains("rev")) { // Debug.Log("Reverse"); tempText.GetComponentInChildren <Text>().text += "\n> Reverse"; ReversePowerUp re = new ReversePowerUp(); tempList.Add(re); // disablePUs[ind, 4] = 1; } else if (powerText.Contains("exp")) { // Debug.Log("Explode"); tempText.GetComponentInChildren <Text>().text += "\n> Explode"; ExplodePowerUp ex = new ExplodePowerUp(); tempList.Add(ex); // disablePUs[ind, 3] = 1; } else if (powerText.Contains("shield")) { // Debug.Log("Shield"); tempText.GetComponentInChildren <Text>().text += "\n> Shield"; BlockPowerUp bl = new BlockPowerUp(); tempList.Add(bl); // disablePUs[ind, 5] = 1; } else // Nullify { // Debug.Log("Nullify"); tempText.GetComponentInChildren <Text>().text += "\n> Nullify"; NullifyPowerUp nu = new NullifyPowerUp(); tempList.Add(nu); // disablePUs[ind, 6] = 1; } selectTurn *= -1; // checkPowerUp(); if (--totalSelect == 0) { initPU.interactable = true; arrowA.gameObject.SetActive(false); arrowB.gameObject.SetActive(false); initPU.GetComponentInChildren <Text>().text = "Begin Game!"; for (int i = 0; i < selectSize; i++) { pbtnList[i].interactable = false; } } }