public virtual void Interact() { if (isReuseable || !hasBeenUsed) { OnInteract?.Invoke(); OnUseText?.Invoke(useText); if (objAudioSource.clip != null) { objAudioSource.Play(); } else { Debug.LogWarning(this.gameObject + " tried to play a null clip"); } hasBeenUsed = true; if (!this.isReuseable) { displayText = string.Empty; OnLookedAtStateChange?.Invoke(); // If the object changes state, look at new display text } } }
protected void StateChange() { OnLookedAtStateChange?.Invoke(); }