Inheritance: MonoBehaviour
Example #1
0
    void Start()
    {
        anim         = GetComponent <Animator> ();
        resumeButton = GameObject.Find("ResumeButton");

        changeBtn         = GameObject.Find("Resume").GetComponent <ChangeButtonText> ();
        finalScore        = GameObject.Find("PauseScore").GetComponent <FinalScoreText> ();
        leaderboardScript = GetComponent <Leaderboard> ();

        UpdateUI();
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        xmlReader.READXML(file, path, node, id);
        Debug.Log(xmlReader.READXML(file, path, node, id));
        //xmlReader.ReadSubnodes(file, path, id);
        //Debug.Log(xmlReader.ReadSubnodes(file, path, id));

        string[] choices = xmlReader.ReadSubnodes(file, path, id);

        for (int i = 0; i < xmlReader.ReadSubnodes(file, path + "/Greetings", id).Length; i++)
        {
            var choiceButton            = (GameObject)Instantiate(button, new Vector3(0, i * 40, 0), Quaternion.identity);
            ChangeButtonText textChange = choiceButton.GetComponent <ChangeButtonText>();
            choiceButton.transform.SetParent(GameObject.FindGameObjectWithTag("Canvas").transform, false);
            textChange.ChangeText(xmlReader.ReadSubnodes(file, path + "/Greetings", id)[i]);
            Debug.Log(xmlReader.ReadSubnodes(file, path + "/Greetings", id)[i]);
        }
    }