Esempio n. 1
0
    public void Interact(PlayerController playerController)
    {
        if (isActivated)
        {
            isActivated = false;
            mecanism.DeactivateMecanism();

            if (mecanism2 != null)
            {
                mecanism2.DeactivateMecanism();
            }

            if (mecanism3 != null)
            {
                mecanism3.DeactivateMecanism();
            }
        }
        else if (!isActivated)
        {
            isActivated = true;
            mecanism.ActivateMecanism();

            if (mecanism2 != null)
            {
                mecanism2.ActivateMecanism();
            }

            if (mecanism3 != null)
            {
                mecanism3.ActivateMecanism();
            }
        }
    }
Esempio n. 2
0
    public void Interact(PlayerController playerController)
    {
        if (isActivated)
        {
            isActivated = false;

            minuteurText.transform.parent.gameObject.SetActive(false);

            mecanism.DeactivateMecanism();

            if (mecanism2 != null)
            {
                mecanism2.DeactivateMecanism();
            }

            if (mecanism3 != null)
            {
                mecanism3.DeactivateMecanism();
            }
        }
        else if (!isActivated)
        {
            isActivated = true;

            timeLeft = timer;

            minuteurText.transform.parent.gameObject.SetActive(true);

            mecanism.ActivateMecanism();

            if (mecanism2 != null)
            {
                mecanism2.ActivateMecanism();
            }

            if (mecanism3 != null)
            {
                mecanism3.ActivateMecanism();
            }


            StartCoroutine(CountDown());
        }
    }
Esempio n. 3
0
    private void OnTriggerExit(Collider other)
    {
        if ((other.tag == "Player" || other.tag == "DarkPlayer" || other.tag == "LightPlayer") && other.GetType() == typeof(BoxCollider))
        {
            mecanism.DeactivateMecanism();

            if (mecanism2 != null)
            {
                mecanism2.DeactivateMecanism();
            }

            if (mecanism3 != null)
            {
                mecanism3.DeactivateMecanism();
            }
        }
    }
    public void Deactivate()
    {
        if (isActivated)
        {
            Debug.Log("Deactivated");
            mecanism.DeactivateMecanism();

            if (mecanism2 != null)
            {
                mecanism2.DeactivateMecanism();
            }

            if (mecanism3 != null)
            {
                mecanism3.DeactivateMecanism();
            }

            isActivated = false;
        }
    }