public void Interact() { if (!activated) { activated = true; if (animator != null) { animator.SetBool("activated", true); } if (target != null) { target.Activate(); } } else { activated = false; if (animator != null) { animator.SetBool("activated", false); } if (target != null) { target.Deactivate(); } } m_AudioPlayer.PlaySFX(sound); }
public void ActivateObject() { Active = true; if (_sourceAndTarget) { _activatableObject.UnlockSource(); } else { _activatableObject.Activate(); } }
private void OnTriggerEnter2D(Collider2D collision) { if (!collision.CompareTag("Projectile")) { if (triggerCount == 0) { if (target != null) { target.Activate(); } if (spriteRenderer != null) { spriteRenderer.color = Color.gray; } m_AudioPlayer.PlaySFX(activateSfx); } ++triggerCount; } }