MusicComponent

Overview

This new music component behaves in the same way as a switch component, In that it allows to switch between components,  but with the addition of allowing to play a transition segment in between.

Overview

This is possible by adding/removing transition behaviours that apart from the transition segment they also allow to set the type of sync (i.e On Beat, On Bar or On Exit Cue).

Any component that exists underneath a music component will allow to override the music settings. This allows to support music tracks that have different tempo sections.

NOTE: The override music properties option is only available if the component is under a music component.

Inspector Elements

Properties

Description

Component

Default component to start playing from

Transition

Properties

Description

From

The component that the transition will check if its currently playing

Transition

Component to play as the transition before switching to the “To” component.

NOTE: If a marker has been detected the component will curry on playing until it reaches the end.

WARNING: If the transition component is set to be Looped the component will keep playing.

To

The target component to switch to

SyncOn

The sync will happen on:

  • OnBeat
  • OnBar
  • OnEnd (End of audio clip)
  • OnMarker(First marker to be detected)

 

Code Support

The Music component provides the following event actions to be called from code,

- SetSwitch

Fabric.EventManager.Instance.PostEvent("NAME OF EVENT", Fabric.EventAction.SetSwitch, "CHILD COMPONENT NAME", gameObject);

 

Watch the following video explaining more about this Component

https://www.youtube.com/watch?v=1sVlMekh4NE&list=PLjo4vf11pt-MWtpdnyJdqJ41khf4YhS8y&index=11