public void FeedBackCombination(CombinationHandler CombinationPlayer, bool reset = false) { if (!reset) { int count = 0; foreach (CombinationHandler.Button currentButton in CombinationPlayer.GetCurrentCombination()) { ButtonsEnemy[count].GetComponent <SpriteRenderer>().color = new Color(1, 1, 1, 0.2f); count++; } if (CurrentCombo < count) { DoParticle(); } CurrentCombo = count; } else { CurrentCombo = 0; for (int i = 0; i < ButtonsEnemy.Count; i++) { ButtonsEnemy[i].GetComponent <SpriteRenderer>().color = new Color(1, 1, 1, 1); } } }
protected virtual void Init() { Combination = GetComponent <CombinationHandler>(); WaveManager = GetComponent <WaveManager>(); powerUp = GetComponent <IPowerUp>(); cm = GetComponent <ComboManager>(); }
void Awake() { //Check if instance already exists if (instance == null) { //if not, set instance to this instance = this; } //If instance already exists and it's not this: else if (instance != this) { //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager. Destroy(gameObject); } Pause = true; Combination = GetComponent <CombinationHandler>(); WaveManager = GetComponent <Tutorial_WaveManager>(); }