void FireEventDebugLog(KoreographyEvent koreoEvent, int sampleTime, int sampleDelta, DeltaSlice deltaSlice) { Debug.Log("Koreography Event Fired"); Debug.Log("Sample Time: " + sampleTime + "\nSample delta: " + sampleDelta + "\nPrevious Frame: " + (sampleTime - sampleDelta)); if (Input.GetKeyDown(KeyCode.Space)) { Debug.Log("F**K THIS"); GameObject.Find("Text").GetComponent <Text>().text = "JA THIS MOFO"; } if (koreoEvent.IsOneOff() && koreoEvent.HasColorPayload()) { // This is a simple Color Payload. Color targetColor = koreoEvent.GetColorValue(); ApplyColorToObjects(ref targetColor); } else if (!koreoEvent.IsOneOff() && koreoEvent.HasGradientPayload()) { // Access the color specified at the current music-time. This is what // drives musical color animations from gradients! Color targetColor = koreoEvent.GetColorOfGradientAtTime(sampleTime); ApplyColorToObjects(ref targetColor); } Color targetColor1 = koreoEvent.GetColorValue(); ApplyColorToObjects(ref targetColor1); }
void AdjustColor(KoreographyEvent evt, int sampleTime, int sampleDelta, DeltaSlice deltaSlice) { // We have prepared two kinds of events that work with this system: // 1) OneOffs that store a Color. // 2) Spans that store a Gradient. // Ensure that we have the correct types before proceeding! if (evt.IsOneOff() && evt.HasColorPayload()) { // This is a simple Color Payload. Color targetColor = evt.GetColorValue(); ApplyColorToObjects(ref targetColor); } else if (!evt.IsOneOff() && evt.HasGradientPayload()) { // Access the color specified at the current music-time. This is what // drives musical color animations from gradients! Color targetColor = evt.GetColorOfGradientAtTime(sampleTime); ApplyColorToObjects(ref targetColor); } }
public static void Draw(Rect displayRect, KoreographyTrack track, KoreographyEvent drawEvent, bool isSelected = false) { if (drawEvent.IsOneOff()) { DrawOneOff(displayRect, drawEvent, isSelected); } else { if (drawEvent.Payload != null) { if (drawEvent.Payload.DoGUI(displayRect, track, isSelected)) { GUI.changed = false; EditorUtility.SetDirty(track); } } else { DrawNoPayload(displayRect, drawEvent, isSelected); } } }
/** * Adds an event to the track. The event is inserted in order by * sample time. The event is NOT added if it is a OneOff event * and another OneOff event exists at the same time. * * TODO: Remove the "no duplicate OneOffs" requirement(?). */ // Editor only? public bool AddEvent(KoreographyEvent addEvent) { // Check/verify that the event fits within the song? bool bAdd = true; if (addEvent.IsOneOff()) { KoreographyEvent sameStartEvent = GetEventAtStartSample(addEvent.StartSample); if (sameStartEvent != null && sameStartEvent.IsOneOff()) { // Disallow the add! bAdd = false; } } if (bAdd) { mEventList.Add(addEvent); EnsureEventOrder(); } return bAdd; }