Ejemplo n.º 1
0
 public void  BackToTitle()
 {
     if (Application.loadedLevelName == "Score")
     {
         ResultMgr.SetScoreData(0);
         Application.LoadLevel("Start");
     }
 }
Ejemplo n.º 2
0
 public void BackToTitle()
 {
     if (SceneManager.GetActiveScene().name == "Score")
     {
         ResultMgr.SetScoreData(0);
         SceneManager.LoadScene("Title");
     }
 }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        Text scoreLabel = GameObject.Find("Canvas/Score").GetComponent <Text>();

        scoreLabel.color = Color.red;
        int Score = ResultMgr.GetScoreData();

        scoreLabel.text = Score.ToString() + " 点";
    }
Ejemplo n.º 4
0
    // Start is called before the first frame update
    void Start()
    {
        //スコア表示用のゲームオブジェクトを習得
        Text scoreLabel = GameObject.Find("Canvas/Text").GetComponent <Text>();

        scoreLabel.color = Color.red;
        //グローバルに宣言したスコアをResuitMgrのスクリプトから読み込む
        int Score = ResultMgr.GetScoreData();

        scoreLabel.text = Score.ToString() + "点";
    }
Ejemplo n.º 5
0
    //選択したボタンのテキストと正解のテキストを比較して正誤の判定
    public void JudgdeAnswer()
    {
        //正解ののデータを変数"answerText"にセット
        string answerText = "井端弘和";
        //選択したボタンのテキストを取得
        Text selectedBtn = this.GetComponentInChildren <Text>();

        if (selectedBtn.text == answerText)
        {
            ResultMgr.SetJudgeData("正解");
            SceneManager.LoadScene("Result");
        }
        else
        {
            ResultMgr.SetJudgeData("不正解");
            SceneManager.LoadScene("Result");
        }
    }
Ejemplo n.º 6
0
    public void NextQuiz()
    {
        int Score = ResultMgr.GetScoreData();

        if (Application.loadedLevelName == "Result")
        {
            if (Score == 0)
            {
                qCount++;
                SceneManager.LoadScene("ゲームオーバー");
            }
            else
            {
                qCount = 0;
                SceneManager.LoadScene("クリア");
                //Application.LoadLevel ("Score");
            }
        }
    }
Ejemplo n.º 7
0
    //選択したボタンのテキストラベルと正解のテキストを比較して正誤を判定
    public void JudgeAnswer()
    {
        //正解のデータをテキストでセットする
        string answerText = "Fattiest portion of tuna";
        //選択したボタンのテキストラベルを取得する
        Text selectedBtn = this.GetComponentInChildren <Text> ();

        if (selectedBtn.text == answerText)
        {
            //選択したデータをグローバル変数に保存
            ResultMgr.SetJudgeData("正解");
            SceneManager.LoadScene("Result");
        }
        else
        {
            //選択したデータをグローバル変数に保存
            ResultMgr.SetJudgeData("不正解");
            SceneManager.LoadScene("Result");
        }
    }
Ejemplo n.º 8
0
    //選択したボタンのテキストラベルと正解のテキストを比較して正誤を判定
    public void JudgeAnswer()
    {
        //正解のデータをテキストでセットする
        string answerText = "A+1=A";
        //選択したボタンのテキストラベルを取得する
        Text selectedBtn = this.GetComponentInChildren <Text> ();

        if (selectedBtn.text == answerText)
        {
            //選択したデータをグローバル変数に保存
            ResultMgr.SetJudgeData("正解");
            Application.LoadLevel("Result");
        }
        else
        {
            //選択したデータをグローバル変数に保存
            ResultMgr.SetJudgeData("不正解");
            Application.LoadLevel("Result");
        }
    }
Ejemplo n.º 9
0
    public void JudgeAnswer()
    {
        GameObject director = GameObject.Find("GameDirector");

        QuizMgr quizMgr    = director.GetComponent <QuizMgr>();
        string  answerText = quizMgr.answer;

        Text selectedBtn = this.GetComponentInChildren <Text>();

        if (selectedBtn.text == answerText)
        {
            Debug.Log("正解");
            ResultMgr.SetJudgeData("正解");
            SceneManager.LoadScene("Result");
        }
        else
        {
            Debug.Log("不正解");
            ResultMgr.SetJudgeData("不正解");
            SceneManager.LoadScene("Result");
        }
    }