Exemplo n.º 1
0
    public void PushResetButton()//画面をリセットする。Resetボタンが押されると呼び出される
    {
        //回答欄を初期化
        inputFieldA.text = "";
        inputFieldB.text = "";
        inputFieldC.text = "";

        //playerの位置を初期化
        RandomPlayerPos();

        //goalの位置を初期化
        RandomGoalPos();

        //正解の設定
        correctPos = goal.transform.position - player.transform.position;

        //メッセージ欄を初期化
        messageText.text = "";

        //オブジェクトの座標表示を初期化
        cl.ErasePos();

        //StartPlayerの削除
        if (GameObject.Find("StartPlayer(Clone)") != null)
        {
            Destroy(GameObject.Find("StartPlayer(Clone)"));
        }

        //GoalPosの位置を初期化
        GameObject.Find("GoalPos").GetComponent <RectTransform>().localPosition = new Vector3(13, 0, 0);
    }