![]() |
Ryle Radio 1.0.0
An open-source "radio" system for Unity, allowing tracks, tuning, broadcasters, and more!
|
An "insulator" for a RadioTrackWrapper - if a RadioOutput is inside the bounds of this object, the affected tracks on it will become quieter. More...
Public Member Functions | |
| float | GetPower (Vector3 _position) |
| Gets the power of this insulator at a specific position. | |
| Public Member Functions inherited from RyleRadio.Components.Base.RadioComponentDataAccessor | |
| override void | Init () |
| Initialises this component and links its affected tracks. | |
| Public Member Functions inherited from RyleRadio.Components.Base.RadioComponent | |
| void | Init () |
| Initialises this component. | |
Public Attributes | |
| Vector3 | innerBoxSize = Vector3.one * 0.9f |
| The size of the inner box of the insulator- inside of this box, insulation is the highest. | |
| Vector3 | outerBoxSize = Vector3.one |
| The size of the outer box of the insulator- outside of this box, insulation is 0- between this and the inner box, insulation is between [0 - 1]. | |
Protected Member Functions | |
| override void | AssignToTrack (RadioTrackWrapper _track) |
| Links this insulator to a track. | |
| override void | RemoveFromTrack (RadioTrackWrapper _track) |
| Unlinks this insulator from a track. | |
| Protected Member Functions inherited from RyleRadio.Components.Base.RadioComponentDataAccessor | |
| void | AssignToTrack (RadioTrackWrapper _track) |
| Links this component to a track. | |
| void | RemoveFromTrack (RadioTrackWrapper _track) |
| Unlinks this component from a track. | |
| virtual void | AccessorInit () |
| Allows extra code for initialization so that Init() can still be called. | |
Properties | |
| Vector3 | InnerBoxSizeAdjusted [get, private set] |
| The innerBoxSize but adjusted with transform.localScale in Update() | |
| Vector3 | OuterBoxSizeAdjusted [get, private set] |
| The outerBoxSize but adjusted with transform.localScale in Update() | |
| bool | ShowApplyToAllOutputs [get] |
| Shows applyToAllOutputsOutside when the x-value of insulation is greater than 0. | |
| Properties inherited from RyleRadio.Components.Base.RadioComponentDataAccessor | |
| List< string > | TrackNames [get] |
| The list of tracks on the RadioData that this component can choose from. | |
| Action< RadioComponent > | OnInit = new(_ => { }) [get, set] |
| Event called when the component is initialized. | |
| Properties inherited from RyleRadio.Components.Base.RadioComponent | |
| RadioData | Data [get] |
| Read-only accessor for data. | |
Private Member Functions | |
| void | Update () |
| Updates cached position and adjusted box sizes. | |
Private Attributes | |
| Vector2 | insulation = new(0, 0.5f) |
| The max and min insulation in the outer and inner boxes. | |
| AnimationCurve | insulationCurve = AnimationCurve.Linear(0, 0, 1, 1) |
| A curve that defines insulation between the inner and outer boxes- the x-value is how far between the inner and outer boxes the output is. | |
| bool | applyToAllOutputsOutside = false |
| Effectively makes this insulator global- when this is true, any output outside of the outer box's range will be affected by the x-value on insulation. | |
| Vector3 | cachedPos |
| The position of the insulator in the previous frame. We cannot access transform.position in the audio thread, so we cache it to this. | |
Additional Inherited Members | |
| Protected Attributes inherited from RyleRadio.Components.Base.RadioComponent | |
| RadioData | data |
| The RadioData (aka just radio) that this component is linked to. | |
An "insulator" for a RadioTrackWrapper - if a RadioOutput is inside the bounds of this object, the affected tracks on it will become quieter.
There aren't really any real-world analogues for the strength of an insulator like this- think of it like putting a radio in a Faraday cage or something I suppose
This also has custom editor stuff in RadioInsulatorEditor
Definition at line 17 of file RadioInsulator.cs.
|
protected |
Links this insulator to a track.
| _track | The track to link to |
Definition at line 91 of file RadioInsulator.cs.
| float RyleRadio.Components.RadioInsulator.GetPower | ( | Vector3 | _position | ) |
Gets the power of this insulator at a specific position.
| _position | The position to evaluate with |
Definition at line 112 of file RadioInsulator.cs.
Referenced by RyleRadio.Tracks.RadioTrackPlayer.GetInsulation().
|
protected |
Unlinks this insulator from a track.
| _track | The track to unlink from |
Definition at line 101 of file RadioInsulator.cs.
|
private |
Updates cached position and adjusted box sizes.
Definition at line 77 of file RadioInsulator.cs.
|
private |
Effectively makes this insulator global- when this is true, any output outside of the outer box's range will be affected by the x-value on insulation.
This only shows when the x-value of insulation is above 0
Definition at line 55 of file RadioInsulator.cs.
Referenced by GetPower().
|
private |
The position of the insulator in the previous frame. We cannot access transform.position in the audio thread, so we cache it to this.
Definition at line 60 of file RadioInsulator.cs.
Referenced by GetPower(), and Update().
| Vector3 RyleRadio.Components.RadioInsulator.innerBoxSize = Vector3.one * 0.9f |
The size of the inner box of the insulator- inside of this box, insulation is the highest.
Definition at line 23 of file RadioInsulator.cs.
Referenced by Update().
|
private |
The max and min insulation in the outer and inner boxes.
If an output is on the edge of the outer box, insulation will be the x-value here. If an output is inside the inner box, insulation will be the y-value. If an output is between the inner and outer boxes, it will be somewhere between the x and y values according to the insulationCurve
If the x-value is above 0, you might want to toggle applyToAllOutputsOutside so this becomes global
Definition at line 41 of file RadioInsulator.cs.
Referenced by GetPower().
|
private |
A curve that defines insulation between the inner and outer boxes- the x-value is how far between the inner and outer boxes the output is.
Definition at line 47 of file RadioInsulator.cs.
Referenced by GetPower().
| Vector3 RyleRadio.Components.RadioInsulator.outerBoxSize = Vector3.one |
The size of the outer box of the insulator- outside of this box, insulation is 0- between this and the inner box, insulation is between [0 - 1].
Definition at line 28 of file RadioInsulator.cs.
Referenced by Update().
|
getprivate set |
The innerBoxSize but adjusted with transform.localScale in Update()
Definition at line 64 of file RadioInsulator.cs.
Referenced by GetPower(), and Update().
|
getprivate set |
The outerBoxSize but adjusted with transform.localScale in Update()
Definition at line 66 of file RadioInsulator.cs.
Referenced by GetPower(), and Update().
|
getprivate |
Shows applyToAllOutputsOutside when the x-value of insulation is greater than 0.
Definition at line 71 of file RadioInsulator.cs.
Referenced by GetPower().