void Awake() { if (instance == null) { instance = this; instance.disableAllBalloonPanels(); ShowGamemodePanel(GameMaster.GetCurrentGameMode()); } else { Destroy(this.gameObject); } }
public void OnBalloonPopped(Balloon balloon) { AudioManager.PlayShiftedClip(SoundClip.BALLOON_POP); balloon.TriggerPopAnimation(); // Handle score and timer // If Balloon is correct if (balloon.GetColor() == instance.currentDisplayColor) { instance.modifyTimer(instance.timeIncrementPerRightBalloon); instance.currentTimerDecrement += instance.timerDecrementIncreasePerBalloon; instance.incrementScore(); GameplayMenuManager.DisplayNotification(NotificationType.RIGHT); } // If Balloon is not correct else { instance.modifyTimer(-instance.timeDecrementPerWrongBalloon * Time.deltaTime); GameplayMenuManager.DisplayNotification(NotificationType.WRONG); } // Setup next balloon instance.resetBalloonColors(); }
public static void IncrementRecentScore() { instance.recentScore++; GameplayMenuManager.UpdateScore(instance.recentScore); }
public void SetColor(BalloonColor newColor) { color = newColor; outterImage.color = GameplayMenuManager.GetBalloonColor(color); }
private void modifyTimer(float time) { instance.currentTimer += time; GameplayMenuManager.SetTimer(instance.currentTimer, instance.startingTimer); }
// Start is called before the first frame update void Start() { instance.currentTimerDecrement = instance.startingTimerDecrement; GameMaster.SetLatestScore(0); GameplayMenuManager.UpdateScore(0); }
private void setNextDisplayBalloon(BalloonColor correctColor) { instance.currentDisplayColor = correctColor; GameplayMenuManager.SetDisplayBalloon(correctColor); }