public void RetrieveText() { if (-1 == m_TextIndex || null == m_GUIText) { return; } m_GUIText.text = StrsManager.Get(m_TextIndex); }
public void RetrieveText() { if (null == m_TextParagraph) { return; } if (m_TextParagraph.m_StrArray.Length != m_TextIndice.Length) { m_TextParagraph.m_StrArray = new string[m_TextIndice.Length]; } for (int i = 0; i < m_TextIndice.Length && i < m_TextParagraph.m_StrArray.Length; ++i) { m_TextParagraph.m_StrArray[i] = StrsManager.Get(m_TextIndice[i]); } m_TextParagraph.m_TextColor = m_TextColor; m_TextParagraph.CreateParagraph(); }
// Update is called once per frame void Update() { switch (m_QuestionState) { case QuestionState.UnActive: if (null != m_GUIAnimationTexture) { m_GUIAnimationTexture.texture = null; } { ShowGUITexture.Show(m_GUIQuestionZoneAnswer, false, true, true); ShowGUITexture.Show(m_GUIWrong, false, true, true); ShowGUITexture.Show(m_GUICorrect, false, true, true); ShowGUITexture.Show(m_GUIInstruction, false, true, true); ShowGUITexture.Show(m_GUIAgain, false, true, true); ShowGUITexture.Show(m_GUIAnswerSymbol, false, true, true); ShowGUITexture.Show(m_GUIAnswerMouseCursor, false, true, true); } // show ready mark. m_GUIReady.enabled = true; m_GUIReady.gameObject.SendMessage("ClearIsDown"); m_QuestionState = QuestionState.Ready; break; case QuestionState.Ready: { GUI_IsDown guiIsDown = m_GUIReady.gameObject.GetComponent <GUI_IsDown>(); if (true == guiIsDown.m_IsDown && 0 != m_QuestionString.Length) { // close ready sign m_GUIReady.enabled = false; // play question m_AnimationPlayer.Setup(m_QuestionString); ShowGUITexture.Show(m_GUIInstruction, true, true, true); string text = StrsManager.Get(m_InstructionQuestion); m_GUIInstruction.GetComponent <GUIText>().text = text; // 把返回關閉 ShowGUITexture.Show(m_GUIBack, false, true, true); m_QuestionState = QuestionState.QuestionAnimation; } } break; case QuestionState.QuestionAnimation: // wait for animation complete if (false == m_AnimationPlayer.m_IsActive) { // show drag sword sign ShowGUITexture.Show(m_GUIInstruction, true, true, true); string text = StrsManager.Get(m_InstructionMoveSword); m_GUIInstruction.GetComponent <GUIText>().text = text; m_QuestionState = QuestionState.DecideTheAnswer; } break; case QuestionState.DecideTheAnswer: DetectAmongAnswers(); UpdateMouseCursor(); break; case QuestionState.Judge: CheckJudge2(); break; case QuestionState.CorrectAnimation: if (false == m_AnimationPlayer.m_IsActive) { // show drag sword sign QuestionTableStruct question = m_LevelGeneratorPtr.m_QuestionTable[m_QuestionString]; m_AnimationPlayer.Setup(question.m_FinishAnimationString); m_QuestionState = QuestionState.FinishAnimation; } break; case QuestionState.FalseAnimation: if (false == m_AnimationPlayer.m_IsActive) { // show drag sword sign ShowGUITexture.Show(m_GUIAgain, true, true, true); } GUI_IsDown guiIsDown = m_GUIAgain.gameObject.GetComponent <GUI_IsDown>(); if (true == guiIsDown.m_IsDown) { m_QuestionState = QuestionState.UnActive; } break; case QuestionState.FinishAnimation: break; } }