void HandleEvent(Spine.TrackEntry trackEntry, Spine.Event e) { if (e.Data.Name == footstepEvent) { footstepAudioSource.pitch = 0.5f + Random.Range(-0.2f, 0.2f); footstepAudioSource.Play(); } }
void HandleEvent(Spine.TrackEntry trackEntry, Spine.Event e) { if (e.Data.Name == footstepEventName) { footstepAudioSource.Stop(); footstepAudioSource.pitch = GetRandomPitch(0.2f); footstepAudioSource.Play(); } }
void HandleCustomEvents(Spine.AnimationState state, int trackIndex, Spine.Event e) { var eventName = e.Data.Name; if (CustomEvents.ContainsKey(eventName)) { CustomEvents[eventName](); } }
protected virtual void HandleEvent(Spine.TrackEntry entry, Spine.Event e) { if (entry != null) { switch (e.Data.Name) { case "Pause": StopAnim(); break; } } }
void HandleEvent(Spine.TrackEntry trackEntry, Spine.Event e) { if (e.Data.Name == "footstep") { if (keyframe2 > 2) { keyframe2 = 1; } txt2.text = keyframe2.ToString(); keyframe2++; } }
private void QueueEvents(TrackEntry entry, float animationTime) { float animationStart = entry.animationStart; float animationEnd = entry.animationEnd; float num3 = animationEnd - animationStart; float num4 = entry.trackLast % num3; ExposedList <Spine.Event> events = this.events; Spine.Event[] items = events.Items; int index = 0; int count = events.Count; while (index < count) { Spine.Event e = items[index]; if (e.time < num4) { break; } if (e.time <= animationEnd) { this.queue.Event(entry, e); } index++; } bool flag = false; if (entry.loop) { flag = (num3 == 0f) || (num4 > (entry.trackTime % num3)); } else { flag = (animationTime >= animationEnd) && (entry.animationLast < animationEnd); } if (flag) { this.queue.Complete(entry); } while (index < count) { Spine.Event event3 = items[index]; if (event3.time >= animationStart) { this.queue.Event(entry, items[index]); } index++; } }
//SkeletonAnimation /* * Int Value: 0 sets ghostingEnabled to false, 1 sets ghostingEnabled to true * Float Value: Values greater than 0 set the spawnRate equal the float value * String Value: Pass RGBA hex color values in to set the color property. IE: "A0FF8BFF" */ void OnEvent(Spine.AnimationState state, int trackIndex, Spine.Event e) { if (e.Data.Name == "Ghosting") { ghostingEnabled = e.Int > 0; if (e.Float > 0) { spawnRate = e.Float; } if (e.String != null) { this.color = HexToColor(e.String); } } }
//SkeletonAnimation /* * Int Value: 0 sets ghostingEnabled to false, 1 sets ghostingEnabled to true * Float Value: Values greater than 0 set the spawnRate equal the float value * String Value: Pass RGBA hex color values in to set the color property. IE: "A0FF8BFF" */ void OnEvent(Spine.TrackEntry trackEntry, Spine.Event e) { if (e.Data.Name == "Ghosting") { ghostingEnabled = e.Int > 0; if (e.Float > 0) { spawnRate = e.Float; } if (e.String != null) { this.color = HexToColor(e.String); } } }
//SkeletonAnimation /* * Int Value: 0 sets ghostingEnabled to false, 1 sets ghostingEnabled to true * Float Value: Values greater than 0 set the spawnRate equal the float value * String Value: Pass RGBA hex color values in to set the color property. IE: "A0FF8BFF" */ void OnEvent(Spine.TrackEntry trackEntry, Spine.Event e) { if (e.Data.Name.Equals("Ghosting", System.StringComparison.Ordinal)) { ghostingEnabled = e.Int > 0; if (e.Float > 0) { spawnRate = e.Float; } if (!string.IsNullOrEmpty(e.stringValue)) { this.color = HexToColor(e.String); } } }
protected virtual void OnSpineEvent(SkeletonAnimator animator, int layer_index, Spine.Event ev) { if (ev.Data.name == AnimatorParameters.FireEvent) { OnFire(); } }
internal void Event(TrackEntry entry, Spine.Event e) { this.eventQueueEntries.Add(new EventQueueEntry(EventType.Event, entry, e)); }
protected abstract void HandleEvents(Spine.AnimationState state, int trackIndex, Spine.Event e);
protected override void HandleEvents(Spine.AnimationState state, int trackIndex, Spine.Event e) { }
void HandleEvent (Spine.TrackEntry trackEntry, Spine.Event e) { if (e.Data.Name == footstepEventName) PlayFootstepSound(); }