示例#1
0
 private void InitShieldFunc()
 {
     shieldTime = GamerPrefs.GetShieldDuration();
     MovingThingsFactory.CanMakeShields = true;
     shieldCover.SetActive(false);
     isShielded = false;
 }
示例#2
0
    private void UpdateBankBalance()
    {
        int bankBalance = GamerPrefs.GetOkane();

        bankBalance += okane;
        GamerPrefs.SetOkane(bankBalance);
    }
    public void HandleSound()
    {
        if (optionsPanelVisible)
        {
            optionsPanelVisible = false;
            optionsPanel.SetActive(false);
        }
        int music = GamerPrefs.GetMusicOn();

        if (music == 1)
        {
            music = 0;
            GamerPrefs.SetMusicOn(0);
        }
        else
        {
            music = 1;
            GamerPrefs.SetMusicOn(1);
        }
        Text soundText = soundButton.GetComponent <Text>();

        soundText.text = (music == 1) ? "Sound On" : "Sound Off";
        willPlay       = (music == 1) ? true : false;
        HandleMainMenuBgMusic();
    }
示例#4
0
    private void InitMusic()
    {
        audioSource = GetComponent <AudioSource>();
        var music = GamerPrefs.GetMusicOn(); // 悪い

        willPlay = (music == 1) ? true : false;
    }
示例#5
0
    private void UpdateBankBalance()
    {
        var bankBalance = GamerPrefs.GetMoney();

        bankBalance += okane;
        GamerPrefs.SetMoney(bankBalance);
    }
示例#6
0
    private void HandleHighScoreText()
    {
        var score = GamerPrefs.GetHighScore();

        highScore      = GameObject.Find("High Score").GetComponent <Text>();
        highScore.text = "High Score: " + score;
    }
示例#7
0
 private void InitShieldFunc()
 {
     shieldTime = GamerPrefs.GetShieldDuration();
     MovingTingsFactory.CAN_MAKE_SHIELDS = true;
     shieldCover.SetActive(false);
     isShielded = false;
 }
示例#8
0
    public void AddMoney()
    {
        int money = GamerPrefs.GetOkane();

        money += 1;
        GamerPrefs.SetOkane(money);
        this.money.text = GamerPrefs.GetOkane().ToString();
    }
    private void HandleMusicButtonText()
    {
        var music = GamerPrefs.GetMusicOn();

        soundText      = soundButton.GetComponent <Text>();
        soundText.text = (music == 1) ? "Sound On" : "Sound Off";
        willPlay       = (music == 1) ? true : false;
        HandleMainMenuBgMusic();
    }
示例#10
0
    // Use this for initialization
    void Start()
    {
        speed       = -1 * Mathf.Sqrt(speed * speed); // using square root incase speed is negative
        audioSource = GetComponent <AudioSource>();
        int music = GamerPrefs.GetMusicOn();          // 悪い

        willPlay = (music == 1) ? true : false;
        dangos   = -1;
        InitShieldFunc();
    }
    private void HandleMusicButtonText()
    {
        // 音楽
        int music = GamerPrefs.GetMusicOn();         // 悪い

        soundText      = GameObject.Find("Sound Button").GetComponent <Text>();
        soundText.text = (music == 1) ? "Sound On" : "Sound Off";
        willPlay       = (music == 1) ? true : false;
        HandleMainMenuBGMusic();
    }
    // UI Update /////////////////////////////////

    // Game Play /////////////////////////////////

    public void HandleGlassSound()
    {
        if (GamerPrefs.GetMusicOn() == 1)
        {
            willPlayMusic = true;
        }
        else
        {
            willPlayMusic = false;
        }
    }
示例#13
0
    public void PlayBackgroundMusic(AudioClip clip)
    {
        var willPlay = GamerPrefs.GetMusicOn() == 1 ? true : false;

        if (!willPlay || bgAudioSource.isPlaying)
        {
            return;
        }
        bgAudioSource.clip = clip;
        bgAudioSource.Play();
    }
示例#14
0
    public void ForcePlayBackgroundMusic(AudioClip clip)
    {
        StopBackgroundMusic();
        var willPlay = GamerPrefs.GetMusicOn() == 1 ? true : false;

        if (!willPlay)
        {
            return;
        }
        bgAudioSource.clip = clip;
        bgAudioSource.Play();
    }
示例#15
0
    public void PlaySfx(AudioClip clip)
    {
        StopSfx();
        var willPlay = GamerPrefs.GetMusicOn() == 1 ? true : false;

        if (!willPlay)
        {
            return;
        }
        sfxAudioSource.clip = clip;
        sfxAudioSource.Play();
    }
 public void SetFinalScore(int score)
 {
     if (score < GamerPrefs.GetHighScore())
     {
         finalScoreText.text = "Score: " + score;
     }
     else
     {
         // TODO: Maybe play an audio High Score
         finalScoreText.text = "High Score: " + score;
         GamerPrefs.SetHighScore(score);
     }
 }
示例#17
0
 public void HandleGameBGMusic()
 {
     _audioSource      = GetComponent <AudioSource>();
     _audioSource.loop = true;
     if (GamerPrefs.GetMusicOn() == 1)
     {
         willPlayMusic = true;
     }
     else
     {
         willPlayMusic = false;
     }
     HandleBGMusicStart();
 }
示例#18
0
 public void UpgradeTimeSlow()
 {
     if (!(timeSlow >= Time_Slow_Cap))
     {
         if (balance >= timeSlowUpgrCost)
         {
             balance  -= timeSlowUpgrCost;
             timeSlow += 2;
             GamerPrefs.SetSlowTimeDuration(timeSlow);
             GamerPrefs.SetOkane(balance);
             HandleOkaneBalance();
             HandleTimeSlow();
         }
     }
 }
示例#19
0
    public void UpgradeTimeSlow()
    {
        var canUpgradeSlowTime = timeSlow >= TimeSlowCap || balance < timeSlowUpgrCost;

        if (canUpgradeSlowTime)
        {
            return;
        }
        balance  -= timeSlowUpgrCost;
        timeSlow += 2;
        GamerPrefs.SetSlowTimeDuration(timeSlow);
        GamerPrefs.SetMoney(balance);
        HandleOkaneBalance();
        HandleTimeSlow();
    }
示例#20
0
    public void UpgradeMaxLife()
    {
        var canUpgradeLife = maxLife >= MaxLifeCap || balance < maxLifeUpgrCost;

        if (canUpgradeLife)
        {
            return;
        }
        balance -= maxLifeUpgrCost;
        maxLife += 1;
        GamerPrefs.SetMaxLife(maxLife);
        GamerPrefs.SetMoney(balance);
        HandleOkaneBalance();
        HandleMaxLife();
    }
示例#21
0
    public void UpgradeShield()
    {
        var canUpgradeShield = shieldDuration >= ShieldDurationCap || balance < shildDurationUpgrCost;

        if (canUpgradeShield)
        {
            return;
        }
        balance        -= shildDurationUpgrCost;
        shieldDuration += 2;
        GamerPrefs.SetShieldDuration(shieldDuration);
        GamerPrefs.SetMoney(balance);
        HandleOkaneBalance();
        HandleShield();
    }
示例#22
0
 public void UpgradeShield()
 {
     if (!(shieldDuration >= Shield_Duration_Cap))
     {
         if (balance >= shildDurationUpgrCost)
         {
             balance        -= shildDurationUpgrCost;
             shieldDuration += 2;
             GamerPrefs.SetShieldDuration(shieldDuration);
             GamerPrefs.SetOkane(balance);
             HandleOkaneBalance();
             HandleShield();
         }
     }
 }
示例#23
0
 public void UpgradeMaxLife()
 {
     if (!(maxLife >= Max_Life_Cap))
     {
         if (balance >= maxLifeUpgrCost)
         {
             balance -= maxLifeUpgrCost;
             maxLife += 1;
             GamerPrefs.SetMaxLife(maxLife);
             GamerPrefs.SetOkane(balance);
             HandleOkaneBalance();
             HandleMaxLife();
         }
     }
 }
示例#24
0
 private void HandleTimeSlow()
 {
     timeSlow = GamerPrefs.GetSlowTimeDuration();
     timeSlowAmountText.text = "時 : " + timeSlow.ToString();
     if (timeSlow < TimeSlowCap)
     {
         timeSlowUpgrCost      = (int)((timeSlow * timeSlow) / 2);
         timeSlowCostText.text = "Upgrade Cost 金: " + timeSlowUpgrCost.ToString();
     }
     else
     {
         timeSlowUpgrCost        = int.MaxValue;
         timeSlowCostText.text   = "Fully Upgraded";
         timeSlowButtonText.text = "X";
     }
 }
示例#25
0
 private void HandleShield()
 {
     shieldDuration = GamerPrefs.GetShieldDuration();
     shieldDurationAmountText.text = "強 : " + shieldDuration.ToString();
     if (shieldDuration < ShieldDurationCap)
     {
         shildDurationUpgrCost       = (int)((shieldDuration * shieldDuration) / 2);
         shieldDurationCostText.text = "Upgrade Cost 金: " + shildDurationUpgrCost.ToString();
     }
     else
     {
         shildDurationUpgrCost         = int.MaxValue;
         shieldDurationCostText.text   = "Fully Upgraded";
         shieldDurationButtonText.text = "X";
     }
 }
示例#26
0
 private void HandleMaxLife()
 {
     maxLife = GamerPrefs.GetMaxLife();
     maxLifeAmountText.text = "心 : " + maxLife.ToString();
     if (maxLife < MaxLifeCap)
     {
         maxLifeUpgrCost      = ((maxLife * 2) * (maxLife * 2)) / 2;
         maxLifeCostText.text = "Upgrade Cost 金: " + maxLifeUpgrCost.ToString();
     }
     else
     {
         maxLifeUpgrCost        = int.MaxValue;
         maxLifeCostText.text   = "Fully Upgraded";
         maxLifeButtonText.text = "X";
     }
 }
示例#27
0
 // Use this for initialization
 void Start()
 {
     gameOn         = true;
     score          = 0;
     scoreText.text = "点 : " + score.ToString();
     okane          = 0;
     okaneText.text = "金 : " + okane.ToString();
     currentHP      = maxHP;
     currentWave    = 1;
     InitLife();
     InitMusic();
     timeSlow = GamerPrefs.GetSlowTimeDuration();
     MovingTingsFactory.DUNGO_FACTORY_WORKING = true;
     MovingTingsFactory.CAN_JUMP_WAVES        = false;
     MovingTingsFactory.CAN_SLOW_HUNGER       = false;
     isTimeSlowed = false;
     ShowCurrentWaveToPlayer();
     ResetIndicators();
 }
示例#28
0
 // Use this for initialization
 private void Start()
 {
     gameOn         = true;
     score          = 0;
     scoreText.text = "点 : " + score.ToString();
     okane          = 0;
     okaneText.text = "金 : " + okane.ToString();
     currentHp      = maxHP;
     currentWave    = 1;
     InitLife();
     InitMusic();
     timeSlow = GamerPrefs.GetSlowTimeDuration();
     MovingThingsFactory.DungoFactoryWorking = true;
     MovingThingsFactory.CanJumpWaves        = false;
     MovingThingsFactory.CanSlowHunger       = false;
     isTimeSlowed = false;
     ShowCurrentWaveToPlayer();
     ResetIndicators();
 }
    public void HandleSound()
    {
        int music = GamerPrefs.GetMusicOn();

        if (music == 1)
        {
            music = 0;
            GamerPrefs.SetMusicOn(0);
        }
        else
        {
            music = 1;
            GamerPrefs.SetMusicOn(1);
        }
        Text soundText = GameObject.Find("Sound Button").GetComponent <Text>();

        soundText.text = (music == 1) ? "Sound On" : "Sound Off";
        willPlay       = (music == 1) ? true : false;
        HandleMainMenuBGMusic();
    }
示例#30
0
    public void SetFinalScore(int score)
    {
        var waveScore = currentWave * 2;
        var servings  = score;

        this.score = servings + waveScore;
        UpdateBankBalance();
        if (this.score < GamerPrefs.GetHighScore())
        {
            deathScoreText.text        = "点 : " + this.score.ToString();
            deathSmallMessageText.text = "Servings: " + servings + "\n+\nWave Bonus: " + waveScore;
            deathPanel.SetActive(true);
        }
        else
        {
            // TODO: Test if this high score scene shit works
            GamerPrefs.SetHighScore(this.score);
            SceneManager.LoadScene("High_SCORE");
        }
    }