예제 #1
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         instance.disableAllBalloonPanels();
         ShowGamemodePanel(GameMaster.GetCurrentGameMode());
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
예제 #2
0
    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();
    }
예제 #3
0
 public static void IncrementRecentScore()
 {
     instance.recentScore++;
     GameplayMenuManager.UpdateScore(instance.recentScore);
 }
예제 #4
0
 public void SetColor(BalloonColor newColor)
 {
     color             = newColor;
     outterImage.color = GameplayMenuManager.GetBalloonColor(color);
 }
예제 #5
0
 private void modifyTimer(float time)
 {
     instance.currentTimer += time;
     GameplayMenuManager.SetTimer(instance.currentTimer, instance.startingTimer);
 }
예제 #6
0
 // Start is called before the first frame update
 void Start()
 {
     instance.currentTimerDecrement = instance.startingTimerDecrement;
     GameMaster.SetLatestScore(0);
     GameplayMenuManager.UpdateScore(0);
 }
예제 #7
0
 private void setNextDisplayBalloon(BalloonColor correctColor)
 {
     instance.currentDisplayColor = correctColor;
     GameplayMenuManager.SetDisplayBalloon(correctColor);
 }