public void PreviousPower() { LinkPowerColors temp = GetComponent <LinkPowerColors>(); if (powerIndex > 0) { powerIndex--; } else { powerIndex = temp.powers.Length - 1; } currentPower = temp.powers[powerIndex]; main.color = currentPower.main; gems.color = currentPower.gems; }
//Power stuff public void NextPower() { LinkPowerColors temp = GetComponent <LinkPowerColors>(); if (powerIndex < temp.powers.Length - 1) { powerIndex++; } else { powerIndex = 0; } currentPower = temp.powers[powerIndex]; main.color = currentPower.main; gems.color = currentPower.gems; }