Exemplo n.º 1
0
    void SeeAction(Image contextPanel)
    {
        PlayerInteract playerInteract = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerInteract>();

        playerInteract.SubscribeEvent(verEvent);
        Destroy(contextPanel.gameObject);
        GameState.Instance.popupOpen = false;
    }
Exemplo n.º 2
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (!activated)
        {
            return;
        }
        print("Collided with something.");
        PlayerInteract playerInteract = collision.gameObject.GetComponent <PlayerInteract>();

        if (playerInteract != null)
        {
            Debug.Log("found playerInteract");
            if (playerInteract.SubscribeEvent(this))
            {
                InitializeEvent();
            }
        }
    }