Ryle Radio 1.0.0
An open-source "radio" system for Unity, allowing tracks, tuning, broadcasters, and more!
Loading...
Searching...
No Matches
RyleRadio.RadioUtils Class Reference

Various utilities used throughout the project. More...

Static Public Member Functions

static float Remap (this float _value, float _from1, float _to1, float _from2, float _to2)
 Remaps a float between [_from1 - _from2] to [_to1 - _to2] Preserves the float's position in the range.
static Vector3 Abs (this Vector3 _value)
 Gets the absolute value of all components of a vector at once.
static Type[] FindDerivedTypes (Type _baseType)
 Gets all types derived from a given one. Does not include:

  • Interfaces
  • Generic classes
  • Abstract classes

Detailed Description

Various utilities used throughout the project.

Definition at line 27 of file RadioUtils.cs.

Member Function Documentation

◆ Abs()

Vector3 RyleRadio.RadioUtils.Abs ( this Vector3 _value)
static

Gets the absolute value of all components of a vector at once.

Parameters
_valueThe vector to convert to absolute values
Returns
The same vector, but any negative numbers have been flipped to positive
Vector3 mixed = new Vector3(-10, 3, 0);
Vector3 abs = mixed.Abs();
Debug.Log(abs); // logs Vector3(10, 3, 0)

Definition at line 55 of file RadioUtils.cs.

◆ FindDerivedTypes()

Type[] RyleRadio.RadioUtils.FindDerivedTypes ( Type _baseType)
static

Gets all types derived from a given one. Does not include:

  • Interfaces
  • Generic classes
  • Abstract classes

Parameters
_baseTypeThe eventType to find derived types of
Returns
An array of types that derive from _baseType

Definition at line 72 of file RadioUtils.cs.

◆ Remap()

float RyleRadio.RadioUtils.Remap ( this float _value,
float _from1,
float _to1,
float _from2,
float _to2 )
static

Remaps a float between [_from1 - _from2] to [_to1 - _to2] Preserves the float's position in the range.

Parameters
_valueA _value between _from1 and _from2
Returns
A _value between _to1 and _to2
float _value = 1;
float output = _value.Remap(0, 5, 2, 15); // remap 1 from [0 - 2] to [5 - 15]
Debug.Log(output); // logs 10

Definition at line 40 of file RadioUtils.cs.


The documentation for this class was generated from the following file: