![]() |
Ryle Radio 1.0.0
An open-source "radio" system for Unity, allowing tracks, tuning, broadcasters, and more!
|
The central data object defining the radio. Contains the tracks and information required to play the radio at runtime.
Has a custom editor at RadioDataEditor.
More...
Public Member Functions | |
| void | Init () |
| Initialise this radio, its tracks, and referenced components. | |
| void | ClearCache () |
| Clears track names and IDs. | |
| bool | TryGetTrack (string _idOrName, out RadioTrackWrapper _trackW, bool _useID=true) |
| Attempts to find a track in this radio using either an ID or a name. | |
Static Public Member Functions | |
| static string | NameToID (string _name) |
| Converts a track's name to ID format. | |
Static Public Attributes | |
| const float | LOW_TUNE = 0 |
| The lower limit for tune on this radio. This may become non-const at some point. | |
| const float | HIGH_TUNE = 1000 |
| The upper limit for tune on this radio. This may become non-const at some point. | |
Properties | |
| Color | GizmoColor [get] |
| Alias for gizmoColor for safety. | |
| Color | GizmoColorSecondary [get] |
| Alias for gizmoColorSecondary for safety. | |
| List< RadioTrackWrapper > | TrackWrappers [get] |
| Alias for trackWs for safety- in documentation we usually call them the tracks, but for code clarity we explicitly call them wrappers in this object. | |
| Action< RadioData > | OnInit = new(_ => { }) [get, set] |
| Event invoked when Init() is called. | |
| Action< RadioData > | BeforeInit = new(_ => { }) [get, set] |
| Event invoked when Init() is called, but at the beginning before anything happens. | |
| List< string > | TrackNames [get] |
| The names of all tracks stored in this radio, used when selecting them in the inspector. | |
| List< string > | TrackIDs [get] |
Private Member Functions | |
| void | PopulateTrackIDs () |
| Fills TrackNames and TrackIDs to match the current content of trackWs. | |
| void | OnValidate () |
| Updates the track names and IDs when this object is changed. | |
Private Attributes | |
| Color | gizmoColor = new Color32(200, 180, 255, 255) |
| The primary colour of gizmos relating to this radio. | |
| Color | gizmoColorSecondary = new Color32(175, 105, 205, 255) |
| The secondary colour of gizmos relating to this radio. | |
| bool | forceClipSampleRate = true |
| Whether or not this radio forces the sample rate on AudioClips it references. | |
| int | forcedSampleRate = 0 |
| The sample rate this radio can force on AudioClips it references. If left at 0, it chooses the project's default sample rate. | |
| List< RadioTrackWrapper > | trackWs = new() { new() } |
| The tracks contained in this radio, editable in the inspector. | |
| List< string > | trackIDs |
| The IDs of all tracks stored in this radio. | |
The central data object defining the radio. Contains the tracks and information required to play the radio at runtime.
Has a custom editor at RadioDataEditor.
Definition at line 17 of file RadioData.cs.
| void RyleRadio.RadioData.ClearCache | ( | ) |
Clears track names and IDs.
Definition at line 166 of file RadioData.cs.
| void RyleRadio.RadioData.Init | ( | ) |
Initialise this radio, its tracks, and referenced components.
Definition at line 152 of file RadioData.cs.
|
static |
Converts a track's name to ID format.
| _name | The name to convert |
Definition at line 97 of file RadioData.cs.
Referenced by TryGetTrack().
|
private |
Updates the track names and IDs when this object is changed.
Definition at line 144 of file RadioData.cs.
|
private |
Fills TrackNames and TrackIDs to match the current content of trackWs.
Definition at line 105 of file RadioData.cs.
Referenced by OnValidate().
| bool RyleRadio.RadioData.TryGetTrack | ( | string | _idOrName, |
| out RadioTrackWrapper | _trackW, | ||
| bool | _useID = true ) |
Attempts to find a track in this radio using either an ID or a name.
| _idOrName | The ID or name of the track to find |
| _trackW | The track that has been found, or null if none was found |
| _useID | If true, this method searches for a matching ID. If false, it searches for a matching name |
Definition at line 179 of file RadioData.cs.
|
private |
Whether or not this radio forces the sample rate on AudioClips it references.
Definition at line 31 of file RadioData.cs.
|
private |
The sample rate this radio can force on AudioClips it references. If left at 0, it chooses the project's default sample rate.
Definition at line 33 of file RadioData.cs.
|
private |
The primary colour of gizmos relating to this radio.
Definition at line 26 of file RadioData.cs.
|
private |
The secondary colour of gizmos relating to this radio.
Definition at line 28 of file RadioData.cs.
|
static |
The upper limit for tune on this radio. This may become non-const at some point.
Definition at line 23 of file RadioData.cs.
|
static |
The lower limit for tune on this radio. This may become non-const at some point.
Definition at line 21 of file RadioData.cs.
|
private |
The IDs of all tracks stored in this radio.
Definition at line 78 of file RadioData.cs.
Referenced by PopulateTrackIDs().
|
private |
The tracks contained in this radio, editable in the inspector.
Definition at line 38 of file RadioData.cs.
Referenced by PopulateTrackIDs().
|
getset |
Event invoked when Init() is called, but at the beginning before anything happens.
Definition at line 53 of file RadioData.cs.
Referenced by Init().
|
get |
Alias for gizmoColor for safety.
Definition at line 42 of file RadioData.cs.
|
get |
Alias for gizmoColorSecondary for safety.
Definition at line 44 of file RadioData.cs.
|
getset |
Event invoked when Init() is called.
Definition at line 51 of file RadioData.cs.
Referenced by Init().
|
get |
Definition at line 79 of file RadioData.cs.
|
get |
The names of all tracks stored in this radio, used when selecting them in the inspector.
Definition at line 63 of file RadioData.cs.
Referenced by ClearCache().
|
get |
Alias for trackWs for safety- in documentation we usually call them the tracks, but for code clarity we explicitly call them wrappers in this object.
Definition at line 47 of file RadioData.cs.
Referenced by Init(), PopulateTrackIDs(), and TryGetTrack().