1using NaughtyAttributes;
26 [SerializeField]
private string id;
31 [Range(0, 500)]
public float gain = 100;
41 [SerializeField, AllowNesting, OnValueChanged(
"CreateTrackLocal"), Dropdown(
"TrackNames")]
54 public string ID =>
id;
57 public float SampleRate =>
track.SampleRate;
60 public int SampleCount
76 private static Type[] trackTypes;
94 private static string[] trackNames;
106 .Select(t => (
string)t.GetField(
"DISPLAY_NAME").GetValue(
null))
117 public AudioClip EditorChildClip => (
track is
ClipRadioTrack clipTrack) ? clipTrack.clip : null;
137 [InitializeOnLoadMethod]
138 public static void OnReload()
163 outTrack.IsInStation =
true;
200 return track.GetSample(_sampleIndex);
Various utilities used throughout the project.
static Type[] FindDerivedTypes(Type _baseType)
Gets all types derived from a given one. Does not include:Interfaces Generic classes Abstract classes
A eventType of RadioTrack that plays from a chosen AudioClip object.
static Type[] TrackTypes
A list of each eventType of track that this wrapper can contain- this is anything that inherits from ...
void Init()
Initialize the track stored in this wrapper.
string trackType
The current eventType of this track as chosen in the editor. Displayed as a dropdown of RadioTrack DI...
void CreateTrackLocal()
Creates a new track in this wrapper. This is called when trackType is updated.
float GetSample(int _sampleIndex)
Gets a sample from the contained track.
string id
The ID of this track.
Vector2 startAndEndRests
The amount of time at the start and end of the track for which there's silence. This allows you to sp...
float Gain
The gain value scaled down to ones- e.g gain at 200 is Gain at 2.
static IStationTrack CreateTrackEditor(string _name)
Gets a new track to be used in a wrapper- note that this is marked as static This is mainly used in ...
float gain
The additional volume of this track. See RadioTrackWrapper.gain.
StationRadioTrackWrapper(IStationTrack _track)
Creates an empty wrapper for a station.
IStationTrack track
The track contained in this wrapper. Note that this is an IStationTrack and not an IRadioTrack like ...
static string[] TrackNames
A list of the names of each eventType in TrackTypes This is what's displayed in the inspector for the...
A RadioTrack that can be played as part of a station.
Tracks to be used on a radio- includes base classes.