Beispiel #1
0
 public IEnumerator ResetGame()
 {
     //Deactivate the previous result
     m_Outcome.gameObject.SetActive(false);
     //Reset game outcome
     m_playerWon = false;
     //Reset player answer
     m_playerAnswer = null;
     //Reset game state
     m_GameHasEnded = false;
     //Reset score
     m_Score.text = "0";
     //Reset the planes to original colour
     foreach (RunaroundAnswer ans in AnswerPlanes)
     {
         ans.gameObject.SetActive(true);
         int tmp = AnswerPlanes.IndexOf(ans);
         //Reset position of answer object
         ans.transform.position = dic_plane_positions[tmp];
         //Reset scale of floor
         ans.Floor.transform.localScale = dic_plane_scale[tmp];
         //Asign the original materials to the floor
         ans.Floor.GetComponent <Renderer>().material = dic_mat_floors[tmp];
         //Asign the orginal materials to the posts
         ans.SignPost.GetComponent <Renderer>().material = dic_mat_posts[tmp];
     }
     yield return(null);
 }
Beispiel #2
0
 private void Start()
 {
     if (GetComponent <RunaroundAnswer>() != null)
     {
         m_ans = GetComponent <RunaroundAnswer>();
     }
 }
Beispiel #3
0
        /// <summary>
        /// This is called when the player steps out of one answer.
        /// </summary>
        /// <param name="ans"></param>
        public void ResetPlane(RunaroundAnswer ans)
        {
            int t = AnswerPlanes.IndexOf(ans);

            //Reset the floor
            ans.Floor.GetComponent <Renderer>().material = dic_mat_floors[t];
            //Reset the signpost
            ans.SignPost.GetComponent <Renderer>().material = dic_mat_posts[t];
            //Reset the player's answer
            m_playerAnswer = null;
            QuestionManager.Instance.answer_Images[AnswerPlanes.IndexOf(ans)].material = dic_mat_floors[AnswerPlanes.IndexOf(ans)];
        }
Beispiel #4
0
 public void CheckPosition(RunaroundAnswer ans)
 {
     if (m_GameHasEnded)
     {
         return;
     }
     //Store the players answer
     m_playerAnswer = ans;
     //Indicate the position of the player on the field
     ans.SignPost.GetComponent <Renderer>().material = mat_position;
     QuestionManager.Instance.answer_Images[AnswerPlanes.IndexOf(ans)].material = mat_currentAnswer;
 }