public void Downgrade() { if (Upgrades.IndexOf(CurrentUpgrade as MonoBehaviour) != 0) { CurrentUpgrade = Upgrades[Upgrades.IndexOf(CurrentUpgrade as MonoBehaviour) - 1] as IGameUpgrade; } else { SceneManager.LoadScene(0); } }
public void Upgrade() { if (Upgrades.IndexOf(CurrentUpgrade as MonoBehaviour) != Upgrades.Count - 1) { CurrentUpgrade = Upgrades[Upgrades.IndexOf(CurrentUpgrade as MonoBehaviour) + 1] as IGameUpgrade; } else { SceneManager.LoadScene(3); } Debug.Log(CurrentUpgrade.GetType()); }
private void Awake() { ValidateUpgrades(); CurrentUpgrade = Upgrades[0] as IGameUpgrade; }