Example #1
0
 void OnMouseDown()
 {
     // Debug.Log( "OnMouseDown()" ) ;
     StrsManager.m_LanguageNow = m_Language;
     PlayerPrefs.SetString("UserLanguage", m_Language.ToString());
     StrsManager.Setup();
 }
Example #2
0
    // Use this for initialization
    void Start()
    {
        m_GUIText = this.gameObject.GetComponent <GUIText>();
        if (null != m_GUIText)
        {
            m_GUIText.material.color = m_TextColor;
        }

        StrsManager.Register(this.gameObject);
    }
Example #3
0
    public void RetrieveText()
    {
        if (-1 == m_TextIndex ||
            null == m_GUIText)
        {
            return;
        }

        m_GUIText.text = StrsManager.Get(m_TextIndex);
    }
Example #4
0
    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();
    }
Example #5
0
    // Use this for initialization
    void Start()
    {
        Language defaultLanguage = Language.Deutsch;
        string   LanguageStr     = PlayerPrefs.GetString("UserLanguage");

        if (LanguageStr == Language.English.ToString())
        {
            defaultLanguage = Language.English;
        }
        else if (LanguageStr == Language.TraditionalChinese.ToString())
        {
            defaultLanguage = Language.TraditionalChinese;
        }
        else if (LanguageStr == Language.Deutsch.ToString())
        {
            defaultLanguage = Language.Deutsch;
        }

        if (false == StrsManager.m_Initialized)
        {
            StrsManager.m_LanguageNow = defaultLanguage;
            StrsManager.Setup();
        }
    }
Example #6
0
    // 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;
        }
    }
Example #7
0
 // Use this for initialization
 void Start()
 {
     m_TextParagraph = this.gameObject.GetComponentInChildren <GUI_TextParagraph>();
     RetrieveText();
     StrsManager.Register(this.gameObject);
 }