示例#1
0
    // This method is meant to be overwritten
    public virtual void Interact()
    {
        Debug.Log("INTERACT");

        if (this.gameObject.CompareTag("Prince"))
        {
            Debug.Log("This is the PRINCE!");
            Prince.Interact();
        }

        if (this.gameObject.CompareTag("Door"))
        {
            _anim = GetComponentInParent <Animator>();
            if (_anim.GetBool("Open"))
            {
                _anim.SetBool("Open", false);
            }
            else
            {
                _anim.SetBool("Open", true);
            }
        }
    }