Beispiel #1
0
    private void Awake()
    {
        Instance      = this;
        transform_    = transform;
        mainCam_      = Camera.main;
        text_         = GetComponentInChildren <TextMeshProUGUI>();
        parentCanvas_ = GetComponentInChildren <Canvas>();

        Hide();
    }
    //Stick this in an object that requires a key to open

    public void OnTriggerStay2D(Collider2D collision)
    {
        if (collision.gameObject.CompareTag("Player"))
        {
            PlayerInteractScript playerInteractScript = PlayerInteractScript.playerInteractScript;
            if (playerInteractScript.hasKey)
            {
                playerInteractScript.UseKey(gameObject);
                Invoke("KeyUsed", 1.5f);
            }
        }
    }
Beispiel #3
0
 private void Awake()
 {
     playerInteractScript = this;
 }