示例#1
0
        // 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);
        }
示例#2
0
        private IEnumerator ActivateItem(float seconds)
        {
            yield return(new WaitForSeconds(seconds));

            CurrentItem.Activate(this);
        }