public void Callout(CalloutControllerGuard.CalloutType calloutType) { if (Task.current.isStarting) { if ( _currentCallout != default(AudibleSound) && _currentCallout.IsPlaying ) { _currentCallout.Stop(); } Debug.Log(calloutType); _currentCallout = CalloutController.Guard .PerformGenericCallout( calloutType, transform.position, _minimapObjectController, this ); } if (_currentCallout == null || !_currentCallout.IsPlaying) { Task.current.Complete(true); } }
private void PlayNextFootStep() { // pick a sound effect AudioClip audioClip; List <AudioClip> clipsToUseRight = _wet ? puddleClipsRightFoot : _audioClipsRightFoot; List <AudioClip> clipsToUseLeft = _wet ? puddleClipLeftFoot : _audioClipsLeftFoot; if (_indexLeft > _indexRight) { // Create normal sound audioClip = clipsToUseRight [_indexLeft % clipsToUseRight.Count]; _indexRight++; } else { audioClip = clipsToUseLeft [_indexRight % clipsToUseLeft.Count]; _indexLeft++; } float volume = 0.4f; int range = 4; if (_wet) { range = 12; volume = 1f; } else if (CurrentWalkState == WalkState.RUNNING) { volume = 1f; range = 12; } else if (CurrentWalkState == WalkState.SNEAKING) { volume = 0.2f; range = 0; } if (_audibleFootsteps) { if (_wet && exitPuddle) { // Create footstep _footStepFactory.Create(transform.position); } AudibleSound.GenerateAudibleSound( transform.position, range, AudibleSound.SoundType.PlayerFootstep, audioClip, this, volume, true ); } }