public void OpeningaGate() { Debug.Log("OpenGate was calledout in MatchInfo"); eventIsOn = true; if (gatesToOpen > 4) { gatesToOpen = 4; } gatesToOpen -= 1; if (gatesToOpen == 3) { GateCrystal01.OpenGate(); medalionGot02 += medallionsPerGate; } else if (gatesToOpen == 2) { GateCrystal02.OpenGate(); medalionGot01 += medallionsPerGate; } else if (gatesToOpen == 1) { GateCrystal03.OpenGate(); medalionGot02 += medallionsPerGate; } else if (gatesToOpen <= 0) { GateCrystal04.OpenGate(); medalionGot01 += medallionsPerGate; } gold += goldPerGate; Debug.Log("Gates to open = " + gatesToOpen); if (gatesToOpen <= 0 && playerLife.isAlive) { DJManager dJManager = this.gameObject.GetComponent <DJManager>(); StartCoroutine(dJManager.AreaClearClip()); gold *= 2; gameWin = true; //Win the game this.gameObject.GetComponent <InterMatchEvents>().AreaClearEvent(); Debug.Log("Gates left is 0 and Player is Alive!"); } else { //GateEvent this.gameObject.GetComponent <InterMatchEvents>().GateComplete(); currentGate += 1; chips += 30; DJManager dJManager = this.gameObject.GetComponent <DJManager>(); StartCoroutine(dJManager.GateCompletePlayJingle()); } }
void CallGameOver() { eventIsOn = true; DJManager dJManager = this.gameObject.GetComponent <DJManager>(); StartCoroutine(dJManager.GameOverClip()); //call a Game over screen and ask the pleayer to watch an ad for double gold this.gameObject.GetComponent <InterMatchEvents>().GameOverEvent(); }