Inheritance: MonoBehaviour
Example #1
0
    // Searches out the game for our objects. Caching them improves performance
    void loadCache()
    {
        // Find Core

        if (myCore == null)
        {
            myCore = GameObject.Find("GameCore").GetComponent <Core>();
        }

        // Find questionText
        if (questionText == null)
        {
            questionText = GameObject.Find("viewCardText").GetComponent <Text> ();
        }

        // Find myAnswer
        if (shortAnswerInput == null)
        {
            shortAnswerInput = GameObject.Find("viewInputAnswer").GetComponent <InputField> ();
        }

        // Find myTimer
        if (myTimer == null)
        {
            myTimer = GameObject.Find("timerText").GetComponent <TimerAgent>();
        }
    }
    // Searches out the game for our objects. Caching them improves performance
    void loadCache()
    {
        // Find Core

        if (myCore == null) {
            myCore = GameObject.Find ("GameCore").GetComponent<Core>();
        }

        // Find questionText
        if (questionText == null) {
            questionText = GameObject.Find ("viewCardText").GetComponent<Text> ();
        }

        // Find myAnswer
        if (shortAnswerInput == null) {
            shortAnswerInput = GameObject.Find ("viewInputAnswer").GetComponent<InputField> ();
        }

        // Find myTimer
        if (myTimer == null) {
            myTimer = GameObject.Find ("timerText").GetComponent<TimerAgent>();
        }
    }