Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (touching && !leave && Input.GetKey("e") && pillarActive == 26)
        {
            TextController.instance.ShowDialog(activatedText);
            eventManager.ActivateEvent(pillarActive);
            leave = true;
            Debug.Log("Active");
        }

        else
        {
            if (touching && !leave && Input.GetKey("e") && eventManager.IsEventActivated(pillarActive - 1))
            {
                TextController.instance.ShowDialog(activatedText);
                eventManager.ActivateEvent(pillarActive);
                leave = true;
                Debug.Log("Active");
            }
            if (touching && !leave && Input.GetKey("e") && !eventManager.IsEventActivated(pillarActive - 1))
            {
                TextController.instance.ShowDialog(unactivatedText);
                resetPuzzle();
                leave = true;
                Debug.Log("Deactive");
            }
        }
    }
 private void OnTriggerEnter2D(Collider2D player)
 {
     if (player.GetComponent<CharacterControl>())
     {
         eventManager.ActivateEvent(eventID);
         Destroy(gameObject);
     }
     
 }
Exemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        if (eventManager.IsEventActivated(19) && eventManager.IsEventActivated(20) && eventManager.IsEventActivated(21))
        {
            eventManager.ActivateEvent(22);
        }
        if (touching  &&!leave&& Input.GetKey("e") && eventManager.IsEventActivated(22))
        {
            TextController.instance.ShowDialog(activatedText);
            leave = true;
            Debug.Log("Active");
        }
        if (touching && !leave&&Input.GetKey("e") && !eventManager.IsEventActivated(22))
        {
            TextController.instance.ShowDialog(unactivatedText);
            leave = true;
            Debug.Log("Deactive");
        }

    }