Inventory Engine v4.2
Loading...
Searching...
No Matches
MoreMountains.Tools.MMRadioSignal Class Referenceabstract

A class used to define a signal, meant to be broadcasted by a MMRadioBroadcaster It'll output a Level value to broadcast, using one time, persistent or driven modes
Meant to be extended. More...

Inherits MonoBehaviour.

Inherited by MoreMountains.Tools.MMRadioSignalAudioAnalyzer, and MoreMountains.Tools.MMRadioSignalGenerator.

Public Types

enum  SignalModes { OneTime , Persistent , Driven }
 the possible modes a radio signal can operate on More...
enum  TimeScales { Unscaled , Scaled }
 whether this signal operates on scaled or unscaled time More...

Public Member Functions

virtual void StartShaking ()
 Starts shaking the values.
virtual void ApplyLevel (float level)
virtual float GraphValue (float time)
virtual void Play ()
 Starts this shaker.
virtual void Stop ()
 Starts this shaker.
virtual float ApplyBias (float t, float bias)
 Applies a bias to a time value.

Public Attributes

SignalModes SignalMode = SignalModes.Persistent
 the selected signal mode
TimeScales TimeScale = TimeScales.Unscaled
 the selected time scale
float Duration = 2f
 the duration of the shake, in seconds
float GlobalMultiplier = 1f
 a global multiplier to apply to the end result of the combination
float CurrentLevel = 0f
 the current level, not to be read from a broadcaster (it's best to use the property than the field, fields generate garbage)
bool Playing = false
 whether or not this shaker is shaking right now
float DriverTime
 the driver time, that can be controlled from another class if you're in Driven mode
bool PlayOnStart = true
 if this is true this shaker will play on awake
MMRadioSignalOnValueChange OnValueChange
 an event to trigger on value change
bool StartShakingButton
 a test button to start shaking

Protected Member Functions

virtual void Awake ()
 On Awake we grab our volume and profile.
virtual void Initialization ()
 Override this method to initialize your shaker.
virtual void ShakeStarts ()
 Describes what happens when a shake starts.
virtual void Update ()
 On Update, we shake our values if needed, or reset if our shake has ended.
virtual void ProcessDrivenMode ()
 A method to override to describe the behaviour in Driven mode.
virtual void ProcessUpdate ()
 A method to override to describe what should happen at update.
virtual void Shake ()
 Override this method to implement shake over time.
virtual void ShakeComplete ()
 Describes what happens when the shake is complete.
virtual void OnEnable ()
 On enable we start shaking if needed.
virtual void OnDestroy ()
 On destroy we stop listening for events.
virtual void OnDisable ()
 On disable we complete our shake if it was in progress.

Protected Attributes

float _signalTime = 0f
float _shakeStartedTimestamp
float _levelLastFrame

Properties

virtual float Level [get]
 the level, to read from a MMRadioBroadcaster
virtual float TimescaleTime [get]
 the time, unscaled or scaled
virtual float TimescaleDeltaTime [get]
 the delta time, unscaled or not

Detailed Description

A class used to define a signal, meant to be broadcasted by a MMRadioBroadcaster It'll output a Level value to broadcast, using one time, persistent or driven modes
Meant to be extended.

Member Enumeration Documentation

◆ SignalModes

the possible modes a radio signal can operate on

  • one time : plays its signal once, goes back to sleep
  • outputs a signal constantly while not sleeping
  • driven : lets you drive the level value from another script
Enumerator
OneTime 
Persistent 
Driven 

◆ TimeScales

whether this signal operates on scaled or unscaled time

Enumerator
Unscaled 
Scaled 

Member Function Documentation

◆ ApplyBias()

virtual float MoreMountains.Tools.MMRadioSignal.ApplyBias ( float t,
float bias )
virtual

Applies a bias to a time value.

Parameters
t
bias
Returns

◆ ApplyLevel()

virtual void MoreMountains.Tools.MMRadioSignal.ApplyLevel ( float level)
virtual

◆ Awake()

virtual void MoreMountains.Tools.MMRadioSignal.Awake ( )
protectedvirtual

On Awake we grab our volume and profile.

◆ GraphValue()

virtual float MoreMountains.Tools.MMRadioSignal.GraphValue ( float time)
virtual

◆ Initialization()

virtual void MoreMountains.Tools.MMRadioSignal.Initialization ( )
protectedvirtual

Override this method to initialize your shaker.

◆ OnDestroy()

virtual void MoreMountains.Tools.MMRadioSignal.OnDestroy ( )
protectedvirtual

On destroy we stop listening for events.

◆ OnDisable()

virtual void MoreMountains.Tools.MMRadioSignal.OnDisable ( )
protectedvirtual

On disable we complete our shake if it was in progress.

◆ OnEnable()

virtual void MoreMountains.Tools.MMRadioSignal.OnEnable ( )
protectedvirtual

On enable we start shaking if needed.

◆ Play()

virtual void MoreMountains.Tools.MMRadioSignal.Play ( )
virtual

Starts this shaker.

◆ ProcessDrivenMode()

virtual void MoreMountains.Tools.MMRadioSignal.ProcessDrivenMode ( )
protectedvirtual

A method to override to describe the behaviour in Driven mode.

◆ ProcessUpdate()

virtual void MoreMountains.Tools.MMRadioSignal.ProcessUpdate ( )
protectedvirtual

A method to override to describe what should happen at update.

◆ Shake()

virtual void MoreMountains.Tools.MMRadioSignal.Shake ( )
protectedvirtual

Override this method to implement shake over time.

Reimplemented in MoreMountains.Tools.MMRadioSignalAudioAnalyzer, and MoreMountains.Tools.MMRadioSignalGenerator.

◆ ShakeComplete()

virtual void MoreMountains.Tools.MMRadioSignal.ShakeComplete ( )
protectedvirtual

Describes what happens when the shake is complete.

Reimplemented in MoreMountains.Tools.MMRadioSignalGenerator.

◆ ShakeStarts()

virtual void MoreMountains.Tools.MMRadioSignal.ShakeStarts ( )
protectedvirtual

Describes what happens when a shake starts.

◆ StartShaking()

virtual void MoreMountains.Tools.MMRadioSignal.StartShaking ( )
virtual

Starts shaking the values.

◆ Stop()

virtual void MoreMountains.Tools.MMRadioSignal.Stop ( )
virtual

Starts this shaker.

◆ Update()

virtual void MoreMountains.Tools.MMRadioSignal.Update ( )
protectedvirtual

On Update, we shake our values if needed, or reset if our shake has ended.

Member Data Documentation

◆ _levelLastFrame

float MoreMountains.Tools.MMRadioSignal._levelLastFrame
protected

◆ _shakeStartedTimestamp

float MoreMountains.Tools.MMRadioSignal._shakeStartedTimestamp
protected

◆ _signalTime

float MoreMountains.Tools.MMRadioSignal._signalTime = 0f
protected

◆ CurrentLevel

float MoreMountains.Tools.MMRadioSignal.CurrentLevel = 0f

the current level, not to be read from a broadcaster (it's best to use the property than the field, fields generate garbage)

◆ DriverTime

float MoreMountains.Tools.MMRadioSignal.DriverTime

the driver time, that can be controlled from another class if you're in Driven mode

◆ Duration

float MoreMountains.Tools.MMRadioSignal.Duration = 2f

the duration of the shake, in seconds

◆ GlobalMultiplier

float MoreMountains.Tools.MMRadioSignal.GlobalMultiplier = 1f

a global multiplier to apply to the end result of the combination

◆ OnValueChange

MMRadioSignalOnValueChange MoreMountains.Tools.MMRadioSignal.OnValueChange

an event to trigger on value change

◆ Playing

bool MoreMountains.Tools.MMRadioSignal.Playing = false

whether or not this shaker is shaking right now

◆ PlayOnStart

bool MoreMountains.Tools.MMRadioSignal.PlayOnStart = true

if this is true this shaker will play on awake

◆ SignalMode

SignalModes MoreMountains.Tools.MMRadioSignal.SignalMode = SignalModes.Persistent

the selected signal mode

◆ StartShakingButton

bool MoreMountains.Tools.MMRadioSignal.StartShakingButton

a test button to start shaking

◆ TimeScale

TimeScales MoreMountains.Tools.MMRadioSignal.TimeScale = TimeScales.Unscaled

the selected time scale

Property Documentation

◆ Level

virtual float MoreMountains.Tools.MMRadioSignal.Level
get

the level, to read from a MMRadioBroadcaster

◆ TimescaleDeltaTime

virtual float MoreMountains.Tools.MMRadioSignal.TimescaleDeltaTime
get

the delta time, unscaled or not

◆ TimescaleTime

virtual float MoreMountains.Tools.MMRadioSignal.TimescaleTime
get

the time, unscaled or scaled


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