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(); } } }
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()); } }
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; } }