コード例 #1
0
ファイル: QuestionPicker.cs プロジェクト: xxkirinxx/CZ3003
    //This method calls the custom firebase object when the object is initialised
    void Awake()
    {
        // Setting up the reference.
        GameObject FireBase = GameObject.Find("Canvas");

        item = FireBase.GetComponent <CustomFirebase>();
    }
コード例 #2
0
    //This method finds the instance of custom firebase
    private void Awake()
    {
        // Setting up the reference.
        GameObject FireBase = GameObject.Find("Canvas");

        item = FireBase.GetComponent <CustomFirebase>();
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != null)
        {
            Debug.Log("Instance already exists, destroying object!");
            Destroy(this);
        }
    }