浏览代码

Adding NPC Audio script

/main
Amel Negra 3 年前
当前提交
94f1ff03
共有 2 个文件被更改,包括 26 次插入0 次删除
  1. 15
      UOP1_Project/Assets/NPCAudio.cs
  2. 11
      UOP1_Project/Assets/NPCAudio.cs.meta

15
UOP1_Project/Assets/NPCAudio.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NPCAudio : CharacterAudio
{
[SerializeField] private AudioCueSO idleSound, talk, footstep;
//when we have the ground detector script, we should check the type to know which footstep sound to play
public void PlayFootstep() => _sfxEventChannel.RaisePlayEvent(footstep, _audioConfig, transform.position);
public void PlayTalk() => _sfxEventChannel.RaisePlayEvent(talk, _audioConfig, transform.position);
//Only bard hare will use the Idle since he sings at that time
public void PlayIdle() => _sfxEventChannel.RaisePlayEvent(idleSound, _audioConfig, transform.position);
}

11
UOP1_Project/Assets/NPCAudio.cs.meta


fileFormatVersion: 2
guid: ed38eca563fcfad4b8f4c8d1a99b7444
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存