コード例 #1
0
 public void InputValue(int n)
 {
     inputNumByButton += n * digit;
     //Debug.Log("inputValue:" + inputNumByButton);
     digit /= 10;
     if (digit == 0)
     {
         if (openKeyNumber == inputNumByButton)
         {
             PlayerPrefs.SetInt("UseableTank27", 1);
             //成功
             announceText.text = "戦車が解放されました";
             SEManager.PlaySound(SEManager.correctSound);
             StartCoroutine(DelayMethod(2f, () =>
             {
                 announceText.text = "";
             }));
         }
         else
         {
             announceText.text = "キーが違います";
             SEManager.PlaySound(SEManager.incorrectSound);
             StartCoroutine(DelayMethod(2f, () =>
             {
                 announceText.text = "";
             }));
         }
         digit            = 1000;
         inputNumByButton = 0;
     }
 }
コード例 #2
0
    public void DisplayResult()
    {
        BGMManager.SetVolume(0.5f);
        resultUIPanel.SetActive(true);
        scoreLabel.SetActive(false);
        bulletNumPanel.SetActive(false);

        GameObject titleText         = resultUIPanel.transform.Find("Title").gameObject;
        GameObject scoreAnnounceText = resultUIPanel.transform.Find("ScoreAnnounceText").gameObject;
        GameObject scoreText         = resultUIPanel.transform.Find("ScoreText").gameObject;

        playerScore = SingleSurvivalStaticData.playerScore;
        CheckReleaseScore(playerScore);

        scoreText.GetComponent <Text>().text = playerScore.ToString();

        StartCoroutine(DelayMethod(1f, () =>
        {
            titleText.SetActive(true);
            SEManager.PlaySound(SEManager.resultSound1);
        }));
        StartCoroutine(DelayMethod(2f, () =>
        {
            scoreAnnounceText.SetActive(true);
            SEManager.PlaySound(SEManager.resultSound1);
        }));
        StartCoroutine(DelayMethod(3f, () =>
        {
            scoreText.SetActive(true);
            SEManager.PlaySound(SEManager.resultSound1);
        }));
        StartCoroutine(DelayMethod(3.1f, () =>
        {
            SEManager.PlaySound(SEManager.resultSound1);
        }));

        StartCoroutine(DelayMethod(6f, () =>
        {
            resultUIPanel.SetActive(false);
            if (PlayerPrefs.GetInt("SingleSurvivalThirdScore") < playerScore || !PlayerPrefs.HasKey("SingleSurvivalThirdScore")) //rankinしたら
            {
                inputPlayerName.SetActive(true);
            }
            else
            {
                SaveHighScore("あなた");
                DisplayRanking();
            }
        }));
    }
コード例 #3
0
    public void DisplayRanking()
    {
        rankingPanel.SetActive(true);

        GameObject bestScoreText   = rankingPanel.transform.Find("BestScoreText").gameObject;
        GameObject secondScoreText = rankingPanel.transform.Find("SecondScoreText").gameObject;
        GameObject thirdScoreText  = rankingPanel.transform.Find("ThirdScoreText").gameObject;
        GameObject playerScoreText = rankingPanel.transform.Find("PlayerScoreText").gameObject;
        GameObject goTitlebutton   = rankingPanel.transform.Find("GoTitleButton").gameObject;

        //GameObject continueButton = rankingPanel.transform.Find("ContinueButton").gameObject;
        //GameObject tweetButton = rankingPanel.transform.Find("TweetButton").gameObject;

        bestScoreText.GetComponent <Text>().text   = "第1位:  " + PlayerPrefs.GetString("SingleMissionBestScoreName") + "  (" + PlayerPrefs.GetInt("SingleMissionBestScore").ToString() + ")";
        secondScoreText.GetComponent <Text>().text = "第2位:  " + PlayerPrefs.GetString("SingleMissionSecondScoreName") + "  (" + PlayerPrefs.GetInt("SingleMissionSecondScore").ToString() + ")";
        thirdScoreText.GetComponent <Text>().text  = "第3位:  " + PlayerPrefs.GetString("SingleMissionThirdScoreName") + "  (" + PlayerPrefs.GetInt("SingleMissionThirdScore").ToString() + ")";
        if (!this.isRankin)
        {
            playerScoreText.GetComponent <Text>().text = "あなた( " + playerScore.ToString() + " )";
        }

        StartCoroutine(DelayMethod(1f, () =>
        {
            bestScoreText.SetActive(true);
            secondScoreText.SetActive(true);
            thirdScoreText.SetActive(true);
        }));
        if (!this.isRankin)
        {
            StartCoroutine(DelayMethod(2f, () =>
            {
                playerScoreText.SetActive(true);
            }));
        }
        StartCoroutine(DelayMethod(4f, () =>
        {
            goTitlebutton.SetActive(true);
            //continueButton.SetActive(true);
            //tweetButton.SetActive(true);
            goTitlebutton.GetComponent <Button>().Select();
            if (this.releaseTankFlag)
            {
                releaseAnnounceText.SetActive(true);
                SEManager.PlaySound(SEManager.correctSound);
            }
        }));
    }
コード例 #4
0
 private void Start()
 {
     StartCoroutine(DelayMethod(3f, () =>
     {
         countDownText.text = "3";
         SEManager.PlaySound(SEManager.countDownSound);
     }));
     StartCoroutine(DelayMethod(4f, () =>
     {
         countDownText.text = "2";
         SEManager.PlaySound(SEManager.countDownSound);
     }));
     StartCoroutine(DelayMethod(5f, () =>
     {
         countDownText.text = "1";
         SEManager.PlaySound(SEManager.countDownSound);
     }));
     StartCoroutine(DelayMethod(6f, () =>
     {
         this.transform.root.gameObject.SetActive(false);
     }));
 }
コード例 #5
0
 public void OnPress()
 {
     if (ptp.GetTankNumber() >= 21)
     {
         //戦車がまだ解放されていなかったら選べない
         if (PlayerPrefs.GetInt("UseableTank" + ptp.GetTankNumber(), 0) != 1)
         {
             SEManager.PlaySound(SEManager.cannotSound);
             return;
         }
     }
     SEManager.PlaySubmitSound();
     if (MainGameController.gameNumber == 1)
     {
         SingleMissionStaticData.selectTankNumber = ptp.GetTankNumber();
         SingleMissionStaticData.playerLife       = ptp.GetLifeNum();
     }
     else if (MainGameController.gameNumber == 2)
     {
         SingleSurvivalStaticData.selectTankNumber = ptp.GetTankNumber();
     }
     psui.SetSelectTankNum(ptp.GetTankNumber());
     psui.PressTankButton();
 }
コード例 #6
0
    public void DisplayResult()
    {
        CountPlayNum();
        BGMManager.SetVolume(0.5f);
        resultUIPanel.SetActive(true);
        scoreLabel.SetActive(false);
        bulletNumCanvas.SetActive(false);

        bool isClear = (SingleMissionStaticData.playerLife > 0);

        GameObject titleText         = resultUIPanel.transform.Find("TitleText").gameObject;
        GameObject destroyScoreText  = resultUIPanel.transform.Find("DestroyScoreText").gameObject;
        GameObject lifeScoreText     = resultUIPanel.transform.Find("LifeScoreText").gameObject;
        GameObject timeScoreText     = resultUIPanel.transform.Find("TimeScoreText").gameObject;
        GameObject sumScoreText      = resultUIPanel.transform.Find("SumScoreText").gameObject;
        GameObject sumScoreValueText = resultUIPanel.transform.Find("SumScoreValueText").gameObject;
        GameObject lineText          = resultUIPanel.transform.Find("Line").gameObject;

        int timeScore = (600 - (int)SingleMissionStaticData.countTime) * 10;

        if (timeScore < 0)
        {
            timeScore = 0;
        }
        if (!isClear)
        {
            timeScore = 0;
        }
        int minute = (int)(SingleMissionStaticData.countTime / 60);
        int second = (int)SingleMissionStaticData.countTime - (minute * 60);

        destroyScoreText.GetComponent <Text>().text = "撃墜点: " + SingleMissionStaticData.playerScore.ToString();
        lifeScoreText.GetComponent <Text>().text    = "残機数: " + SingleMissionStaticData.playerLife * 1000 + " (" + SingleMissionStaticData.playerLife + ")";
        timeScoreText.GetComponent <Text>().text    = "かかった時間: " + timeScore + " (" + minute + "分" + second + "秒)";

        playerScore = SingleMissionStaticData.playerScore + (SingleMissionStaticData.playerLife * 100) + timeScore;
        CheckReleaseScore(playerScore);
        sumScoreValueText.GetComponent <Text>().text = playerScore.ToString();


        StartCoroutine(DelayMethod(2f, () =>
        {
            titleText.SetActive(false);
        }));
        StartCoroutine(DelayMethod(3f, () =>
        {
            destroyScoreText.SetActive(true);
            lifeScoreText.SetActive(true);
            timeScoreText.SetActive(true);
            SEManager.PlaySound(SEManager.resultSound0);
        }));
        StartCoroutine(DelayMethod(4f, () =>
        {
            lineText.SetActive(true);
            sumScoreText.SetActive(true);
        }));
        StartCoroutine(DelayMethod(5f, () =>
        {
            sumScoreValueText.SetActive(true);
            SEManager.PlaySound(SEManager.resultSound1);
        }));
        StartCoroutine(DelayMethod(5.1f, () =>
        {
            SEManager.PlaySound(SEManager.resultSound1);
        }));

        StartCoroutine(DelayMethod(8f, () =>
        {
            destroyScoreText.SetActive(false);
            lifeScoreText.SetActive(false);
            timeScoreText.SetActive(false);
            lineText.SetActive(false);
            sumScoreText.SetActive(false);
            sumScoreValueText.SetActive(false);

            if (PlayerPrefs.GetInt("SingleMissionThirdScore") < playerScore || !PlayerPrefs.HasKey("SingleMissionThirdScore")) //rankinしたら
            {
                inputPlayerName.SetActive(true);
            }
            else
            {
                SaveHighScore("あなた");
                DisplayRanking();
            }
        }));
    }