summaryrefslogtreecommitdiff
path: root/Thronefall_v1.0/Decompile/PlayerWeaponAudio.cs
blob: 90cbfd5b3de0ce25c923133b8d58c80077d7bb7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using UnityEngine;

public class PlayerWeaponAudio : MonoBehaviour
{
	public enum WeaponType
	{
		Sword,
		Spear,
		Bow
	}

	public ManualAttack autoWeapon;

	public ManualAttack activeAbility;

	public WeaponType weaponType;

	public float pitchRange;

	public float volume = 0.75f;

	[HideInInspector]
	private AudioSet.ClipArray attackSound;

	private bool initialized;

	public AudioSet.ClipArray AttackSound
	{
		get
		{
			if (!initialized)
			{
				Initialize();
			}
			return attackSound;
		}
	}

	private void Initialize()
	{
		switch (weaponType)
		{
		case WeaponType.Bow:
			attackSound = ThronefallAudioManager.Instance.audioContent.PlayerBow;
			break;
		case WeaponType.Spear:
			attackSound = ThronefallAudioManager.Instance.audioContent.PlayerSpear;
			break;
		case WeaponType.Sword:
			attackSound = ThronefallAudioManager.Instance.audioContent.PlayerSword;
			break;
		}
		initialized = true;
	}
}