浏览代码

Disable audio sfx events on animation during cutscenes

/main
Amel 3 年前
当前提交
38195933
共有 10 个文件被更改,包括 32 次插入21 次删除
  1. 3
      UOP1_Project/Assets/Prefabs/Characters/NPCs_BasePrefabs/Gluecose.prefab
  2. 3
      UOP1_Project/Assets/Prefabs/Characters/NPCs_BasePrefabs/Groen.prefab
  3. 3
      UOP1_Project/Assets/Prefabs/Characters/NPCs_BasePrefabs/Klipper.prefab
  4. 1
      UOP1_Project/Assets/Prefabs/Characters/NPCs_BasePrefabs/Townsfolk_F.prefab
  5. 1
      UOP1_Project/Assets/Prefabs/Characters/NPCs_BasePrefabs/Townsfolk_M.prefab
  6. 7
      UOP1_Project/Assets/Scripts/Characters/CharacterAudio.cs
  7. 1
      UOP1_Project/Assets/Scripts/Characters/CharacterAudio.cs.meta
  8. 10
      UOP1_Project/Assets/Scripts/Characters/CritterAudio.cs
  9. 8
      UOP1_Project/Assets/Scripts/Characters/NPCAudio.cs
  10. 16
      UOP1_Project/Assets/Scripts/Characters/ProtagonistAudio.cs

3
UOP1_Project/Assets/Prefabs/Characters/NPCs_BasePrefabs/Gluecose.prefab


m_EditorClassIdentifier:
_sfxEventChannel: {fileID: 11400000, guid: c3c796b7c31ad3647a3fbae42e74764e, type: 2}
_audioConfig: {fileID: 11400000, guid: 8d4217c8fabf9824490196f34baf326a, type: 2}
_gameState: {fileID: 11400000, guid: 159f9c22d98e249ceb08f2c5de2311a4, type: 2}
idleSound: {fileID: 11400000, guid: adf34253665d2004ca6f5fdd979baddc, type: 2}
moveSound: {fileID: 11400000, guid: 87f5311fb0b12fb4e979c1e531b4c29f, type: 2}
attackSound: {fileID: 11400000, guid: 2647e8ddc9ab3f74b8b50871e43f34d2, type: 2}

- target: {fileID: 919132149155446097, guid: 63937395ff7a888419d4b8fe450d3c91,
type: 3}
propertyPath: m_Name
value: SlimeCritter
value: Gluecose
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 63937395ff7a888419d4b8fe450d3c91,
type: 3}

3
UOP1_Project/Assets/Prefabs/Characters/NPCs_BasePrefabs/Groen.prefab


m_EditorClassIdentifier:
_sfxEventChannel: {fileID: 11400000, guid: c3c796b7c31ad3647a3fbae42e74764e, type: 2}
_audioConfig: {fileID: 11400000, guid: 8d4217c8fabf9824490196f34baf326a, type: 2}
_gameState: {fileID: 11400000, guid: 159f9c22d98e249ceb08f2c5de2311a4, type: 2}
idleSound: {fileID: 11400000, guid: 24fe7a7fe0b3b404c9f611646c660a15, type: 2}
moveSound: {fileID: 0}
attackSound: {fileID: 11400000, guid: 8a1e12d8d2b97134ba56d78de73d6b1a, type: 2}

- target: {fileID: 919132149155446097, guid: 415e24332f8993c4da4c452ed27d2873,
type: 3}
propertyPath: m_Name
value: PlantCritter
value: Groen
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 415e24332f8993c4da4c452ed27d2873,
type: 3}

3
UOP1_Project/Assets/Prefabs/Characters/NPCs_BasePrefabs/Klipper.prefab


m_EditorClassIdentifier:
_sfxEventChannel: {fileID: 11400000, guid: c3c796b7c31ad3647a3fbae42e74764e, type: 2}
_audioConfig: {fileID: 11400000, guid: 8d4217c8fabf9824490196f34baf326a, type: 2}
_gameState: {fileID: 11400000, guid: 159f9c22d98e249ceb08f2c5de2311a4, type: 2}
idleSound: {fileID: 11400000, guid: 0ecf2a2b2f934f1488d6b9300935b22e, type: 2}
moveSound: {fileID: 11400000, guid: d96b99268ed844a4ea91f8a7fb179357, type: 2}
attackSound: {fileID: 11400000, guid: f528618e85c11d3429ed3d2cc7ce548d, type: 2}

- target: {fileID: 919132149155446097, guid: 7ded5f0996b0fce4688147fd67a029e5,
type: 3}
propertyPath: m_Name
value: RockCritter
value: Klipper
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 7ded5f0996b0fce4688147fd67a029e5,
type: 3}

1
UOP1_Project/Assets/Prefabs/Characters/NPCs_BasePrefabs/Townsfolk_F.prefab


m_EditorClassIdentifier:
_sfxEventChannel: {fileID: 11400000, guid: c3c796b7c31ad3647a3fbae42e74764e, type: 2}
_audioConfig: {fileID: 11400000, guid: 8d4217c8fabf9824490196f34baf326a, type: 2}
_gameState: {fileID: 11400000, guid: 159f9c22d98e249ceb08f2c5de2311a4, type: 2}
singShort: {fileID: 0}
singLong: {fileID: 0}
talk: {fileID: 11400000, guid: efd56f3ee0f40204e86ddb3689497004, type: 2}

1
UOP1_Project/Assets/Prefabs/Characters/NPCs_BasePrefabs/Townsfolk_M.prefab


m_EditorClassIdentifier:
_sfxEventChannel: {fileID: 11400000, guid: c3c796b7c31ad3647a3fbae42e74764e, type: 2}
_audioConfig: {fileID: 11400000, guid: 8d4217c8fabf9824490196f34baf326a, type: 2}
_gameState: {fileID: 11400000, guid: 159f9c22d98e249ceb08f2c5de2311a4, type: 2}
singShort: {fileID: 0}
singLong: {fileID: 0}
talk: {fileID: 11400000, guid: e3b212b9803f0bf48b88faa7ee22b5c7, type: 2}

7
UOP1_Project/Assets/Scripts/Characters/CharacterAudio.cs


{
[SerializeField] protected AudioCueEventChannelSO _sfxEventChannel = default;
[SerializeField] protected AudioConfigurationSO _audioConfig = default;
[SerializeField] protected GameStateSO _gameState = default;
protected void PlayAudio(AudioCueSO audioCue, AudioConfigurationSO audioConfiguration, Vector3 positionInSpace = default)
{
if (_gameState.CurrentGameState != GameState.Cutscene)
_sfxEventChannel.RaisePlayEvent(audioCue, audioConfiguration, positionInSpace);
}
}

1
UOP1_Project/Assets/Scripts/Characters/CharacterAudio.cs.meta


defaultReferences:
- _sfxEventChannel: {fileID: 11400000, guid: c3c796b7c31ad3647a3fbae42e74764e, type: 2}
- _audioConfig: {fileID: 11400000, guid: 046cbfdf9a2c0964ea8a01b8e3814e51, type: 2}
- _gameState: {fileID: 11400000, guid: 159f9c22d98e249ceb08f2c5de2311a4, type: 2}
executionOrder: 0
icon: {instanceID: 0}
userData:

10
UOP1_Project/Assets/Scripts/Characters/CritterAudio.cs


{
[SerializeField] private AudioCueSO idleSound, moveSound, attackSound, gettingHitSound, deathSound;
public void PlayIdleSound() => _sfxEventChannel.RaisePlayEvent(idleSound, _audioConfig, transform.position);
public void PlayIdleSound() => PlayAudio(idleSound, _audioConfig, transform.position);
public void PlayMoveSound() => _sfxEventChannel.RaisePlayEvent(moveSound, _audioConfig, transform.position);
public void PlayAttackSound() => _sfxEventChannel.RaisePlayEvent(attackSound, _audioConfig, transform.position);
public void PlayGettingHitSound() => _sfxEventChannel.RaisePlayEvent(gettingHitSound, _audioConfig, transform.position);
public void PlayDeathSound() => _sfxEventChannel.RaisePlayEvent(deathSound, _audioConfig, transform.position);
public void PlayMoveSound() => PlayAudio(moveSound, _audioConfig, transform.position);
public void PlayAttackSound() => PlayAudio(attackSound, _audioConfig, transform.position);
public void PlayGettingHitSound() => PlayAudio(gettingHitSound, _audioConfig, transform.position);
public void PlayDeathSound() => PlayAudio(deathSound, _audioConfig, transform.position);
}

8
UOP1_Project/Assets/Scripts/Characters/NPCAudio.cs


[SerializeField] private AudioCueSO singShort, singLong, 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);
public void PlayFootstep() => PlayAudio(footstep, _audioConfig, transform.position);
public void PlayTalk() => PlayAudio(talk, _audioConfig, transform.position);
public void PlaySingShort() => _sfxEventChannel.RaisePlayEvent(singShort, _audioConfig, transform.position);
public void PlaySingLong() => _sfxEventChannel.RaisePlayEvent(singLong, _audioConfig, transform.position);
public void PlaySingShort() => PlayAudio(singShort, _audioConfig, transform.position);
public void PlaySingLong() => PlayAudio(singLong, _audioConfig, transform.position);
}

16
UOP1_Project/Assets/Scripts/Characters/ProtagonistAudio.cs


{
[SerializeField] private AudioCueSO caneSwing, liftoff, land, objectPickup, footstep, getHit, die, talk;
public void PlayFootstep() => _sfxEventChannel.RaisePlayEvent(footstep, _audioConfig, transform.position);
public void PlayJumpLiftoff() => _sfxEventChannel.RaisePlayEvent(liftoff, _audioConfig, transform.position);
public void PlayJumpLand() => _sfxEventChannel.RaisePlayEvent(land, _audioConfig, transform.position);
public void PlayCaneSwing() => _sfxEventChannel.RaisePlayEvent(caneSwing, _audioConfig, transform.position);
public void PlayObjectPickup() => _sfxEventChannel.RaisePlayEvent(objectPickup, _audioConfig, transform.position);
public void PlayGetHit() => _sfxEventChannel.RaisePlayEvent(getHit, _audioConfig, transform.position);
public void PlayDie() => _sfxEventChannel.RaisePlayEvent(die, _audioConfig, transform.position);
public void PlayTalk() => _sfxEventChannel.RaisePlayEvent(talk, _audioConfig, transform.position);
public void PlayFootstep() => PlayAudio(footstep, _audioConfig, transform.position);
public void PlayJumpLiftoff() => PlayAudio(liftoff, _audioConfig, transform.position);
public void PlayJumpLand() => PlayAudio(land, _audioConfig, transform.position);
public void PlayCaneSwing() => PlayAudio(caneSwing, _audioConfig, transform.position);
public void PlayObjectPickup() => PlayAudio(objectPickup, _audioConfig, transform.position);
public void PlayGetHit() => PlayAudio(getHit, _audioConfig, transform.position);
public void PlayDie() => PlayAudio(die, _audioConfig, transform.position);
public void PlayTalk() => PlayAudio(talk, _audioConfig, transform.position);
}
正在加载...
取消
保存