コード例 #1
0
    public override void Enter()
    {
        _controller.navMeshAgent.velocity  = Vector3.zero;
        _controller.navMeshAgent.isStopped = true;
        _doorButton = GetDoorButton();

        if (_doorButton)
        {
            _basicAudio = _doorButton.GetBasicAudio();
            _coroutine  = _controller.StartCoroutine(PoundOnDoor());
        }
    }
コード例 #2
0
 /// <summary>
 /// This method plays the soundfx.
 /// </summary>
 /// <param name="soundfx">The soundfx to play, of type
 ///                       BasicAudio</param>
 private void PlaySoundFx(BasicAudio soundfx)
 => _soundfxSource.PlayOneShot(soundfx.Clip, soundfx.Volume);