// ReSharper disable once UnusedMember.Global public void OnUseItem(InputAction.CallbackContext context) { if (!context.started || CurrentItem == null) { return; } if (CurrentItem.GetAudio() != null) { itemSound.clip = CurrentItem.GetAudio(); itemSound.Play(); } activeOverlay.SetActive(true); CurrentItem.Activate(this); }
private IEnumerator ActivateItem(float seconds) { yield return(new WaitForSeconds(seconds)); CurrentItem.Activate(this); }