コード例 #1
0
    //doesn"t work when instantiate gameObject

    /*
     * void Awake()
     * {
     *  instance = this;
     * }*/


    void Start()
    {
        instance = this;
        Hint h = gameObject.GetComponent <Interactable>().hint;

        if (h != null)
        {
            h.initialise();
        }
        else
        {
            Debug.Log("getcomponent not working in HintImage");
        }
        if (r != null)
        {
            initRiddle();
        }
        //update sprite
        im.sprite = h.GetSprite();

        playercontrol = GameObject.FindObjectOfType <Move>();
        if (playercontrol == null)
        {
            Debug.LogWarning("Can't find instance of move script");
        }

        HideHint();
    }
コード例 #2
0
    private void init()
    {
        Hint h = gameObject.GetComponent <Interactable>().hint;

        if (h != null)
        {
            h.initialise();
        }

        //update sprite
        im.sprite = h.GetSprite();

        playercontrol = GameObject.FindObjectOfType <Move>();
        if (playercontrol == null)
        {
            Debug.LogWarning("Can't find instance of move script");
        }

        HideHint();
    }