public void OnPlay(string debugReason, bool forceInterrupt, Cue cue, CueBehavior cueBehavior, Event[] aoEvents) { isPlaying = true; BroadcastMessageToPlayer(layer, player, runtimeTransform, cueBehavior, Cue.MessageEvent.OnPlay); if (cue != null && CueIsPlaylist(cue)) { InitializePerformanceInternal(debugReason + " / " + cue.name, layer, cue, player, runtimeTransform, forceInterrupt, OnPlaylistEnd); } else { Event[] eventsToPlay = cueBehavior != null ? cueBehavior.events : aoEvents; string eventsName = cue != null ? cue.name : (cueBehavior != null ? cueBehavior.name : aoEvents[0].name); player.SubscribeToPlayEnd(layer, OnEventEnd); player.PlayEvents(debugReason, eventsName, runtimeTransform, eventsToPlay, layer, cueBehavior != null ? cueBehavior.overrideDuration : -1, forceInterrupt); } }