public void InitializeChannel(bool isTopLevel, int layer, EventPlayer player, Playlist.Channel playlistChannel, MiniTransform suppliedTransform, Performance performance) { this.playlistChannel = playlistChannel; this.player = player; //only if it has subcues if (playlistChannel.useRandomChoice) { List <int> enabledIndicies = new List <int>(); for (int i = 0; i < playlistChannel.cues.Length; i++) { if (playlistChannel.cues[i].gameObject.activeSelf) { enabledIndicies.Add(i); } i++; } cueIndex = enabledIndicies.RandomChoice(); } else { cueIndex = 0; } if (!isTopLevel) { if (SkipAheadPastDisabledCues(performance)) { return; } } curCueRepeats = 0; isActive = true; head.OnStart(isTopLevel, playlistChannel, GetCurrentCue(), GetCurrentCueBehavior(), GetCurrentPlayingEvents(), layer, player, suppliedTransform); }
public void OnStart(bool isTopLevel, Playlist.Channel playlistChannel, Cue cue, CueBehavior cueBehavior, Event[] aoEvents, int layer, EventPlayer player, MiniTransform suppliedTransform) { this.cueBehavior = cueBehavior; this.player = player; this.layer = layer; this.playImmediate = cueBehavior != null && cueBehavior.playImmediate; isActive = true; posReady = true; isPlaying = false; // if we're loading a sub cue of a cue playlist if (!isTopLevel) { Vector3 posOffset = cueBehavior != null ? cueBehavior.positionOffset : Vector3.zero; Vector3 rotOffset = cueBehavior != null ? cueBehavior.rotationOffset : Vector3.zero; Vector3 lPos = cue.transform.localPosition; if (posOffset != Vector3.zero) { lPos += posOffset; } Quaternion lRot = cue.transform.localRotation; if (rotOffset != Vector3.zero) { lRot = Quaternion.Euler(lRot.eulerAngles + rotOffset); } suppliedTransform = new MiniTransform(suppliedTransform.pos + (suppliedTransform.rot * lPos), suppliedTransform.rot * lRot); } this.runtimeTransform = suppliedTransform; BroadcastMessageToPlayer(layer, player, runtimeTransform, cueBehavior, Cue.MessageEvent.OnStart); InitializeSnap(); }