private void OnTriggerExit(Collider other) { if (other.gameObject.CompareTag("Ball")) { linked_object.Deactivate(); } }
public void OnTriggerExit2D(Collider2D other) { if (other.tag == "Character" || other.tag == "Box") { Debug.Log("Plate depressured"); activatable.Deactivate(); } }
public void Deactivate() { if (!bonusActivator && objectToActivate) { objectToActivate.Deactivate(); } activated = false; spriteRenderer.sprite = deactivatedSprite; }
private void OnTriggerExit2D(Collider2D collision) { if (collision.tag == "Player") { activatable.Deactivate(); if (destroyAfterUse) { Destroy(gameObject); } } }
public void PowerDownReceptor() { if (_activationCount == 0) { return; } _activationCount--; if (_activationCount == 0 && inactiveMaterialsArray != null) { _activating = true; activatable.Deactivate(); audioSource.PlayOneShot(deactivatedClip); mesh.materials = inactiveMaterialsArray; } }
void Update() { if (isOnArea) { if (Input.GetKeyDown(KeyCode.E)) { if (!toggle) { activatable.Activate(); click.Play(); } else { activatable.Deactivate(); click.Play(); Debug.Log("Deactivate lever"); } toggle = !toggle; } } }