Пример #1
0
    void Start()
    {
        m_before_event_callback_enable = false;
        GameObject go = GameObject.Find("Question Panel");

        m_question_controller = go.GetComponent <QuestionController>();
        go                = GameObject.Find("StopWatch");
        m_stopwatch       = go.GetComponent <StopWatch>();
        go                = GameObject.Find("Master");
        m_master_animator = go.GetComponentInChildren <Animator>();
        go                = GameObject.Find("MengNanValue");
        m_mengnan_value   = go.GetComponent <MengNanValue>();
        go                = GameObject.Find("GameController");
        m_game_controller = go.GetComponent <GameController>();
    }
Пример #2
0
    public void TimeOut()
    {
        if (false)
        {
            GameObject   mengnan_value     = GameObject.Find("MengNanValue");
            MengNanValue mengnan_component = mengnan_value.GetComponent <MengNanValue>();
            int          value             = mengnan_component.GetValue();
            mengnan_component.SetValue(value - 10);
        }

        {
            // Debug.Log("it should ask next question");
            // GameObject go = GameObject.Find("Question Panel");
            // 使用 GameObject.Find 有可能找到的是 prefab,而非场景中的对象
            m_master_ai.set_state(MyConst.ACTION_STATE_ANSWER_TIMEOUT);
            // QuestionController component = questionCtrl;
            // component.AskQuestion();
            //StartTheWatch();
        }
    }