Ejemplo n.º 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();
    }
Ejemplo n.º 2
0
 private void OnEnable()
 {
     hi = HintImage.instance;
     hi.onHintChangedCallback += init;
 }