Space-Smash-Out/Assets/ScriptableObjects/ShipAudio.cs

50 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using log4net.Config;
using ShipHandling;
using UnityEngine;
/// <summary>
/// Maps all the types of sounds a ship can make,
/// to the names of the sounds that will be used.
/// </summary>
[CreateAssetMenu(fileName = "ShipSounds", menuName = "ScriptableObjects/ShipSounds")]
[ExecuteInEditMode]
public class ShipAudio : ScriptableObject
{
public List<ShipSoundToName> shipSounds = new()
{
new ShipSoundToName(ShipSound.Thruster, "thruster"),
new ShipSoundToName(ShipSound.Booster, "booster"),
new ShipSoundToName(ShipSound.Tackling, "normal_tackle"),
new ShipSoundToName(ShipSound.TacklingCritical, "critical_tackle"),
new ShipSoundToName(ShipSound.EnterZone, "zone_change_in"),
new ShipSoundToName(ShipSound.LeaveZone, "zone_change_out")
};
}
[Serializable]
public class ShipSoundToName
{
public ShipSound sound;
public string soundName;
public ShipSoundToName(ShipSound s, string name)
{
sound = s;
soundName = name;
}
}
public enum ShipSound
{
Thruster,
Booster,
LeaveZone,
EnterZone,
Tackling,
TacklingCritical,
BeingTackled,
BeingTackledCritical,
Dying
}