public void RemoveCurrentComponent(GameObject sphere) { PlayableClip[] playableClips = sphere.GetComponents <PlayableClip>(); foreach (PlayableClip playableClip in playableClips) { if (Mathf.Abs(playableClip.startTime - this.start) < 1e-5f && Mathf.Abs(playableClip.endTime - this.end) < 1e-5f) { GatedClip storyPoint = playableClip as GatedClip; if (storyPoint != null) { GatedClip toDelete = storyPoint; MonoBehaviour.DestroyImmediate(toDelete); if (sp != null) { sp._component = null; } } else { MonoBehaviour.DestroyImmediate(playableClip); _clipComponent = null; } break; } } }
public override bool Equals(System.Object obj) { PlayableClip otherPlayableClip = obj as PlayableClip; if (otherPlayableClip == null) { return(false); } return(Math.Abs(this.startTime - otherPlayableClip.startTime) < 1e-5f && Math.Abs(this.endTime - otherPlayableClip.endTime) < 1e-5f); }
public int CompareTo(object obj) { if (obj == null) { return(1); } PlayableClip otherPlayableClip = obj as PlayableClip; if (otherPlayableClip == null) { return(1); } return(this.timelinePos.CompareTo(otherPlayableClip.timelinePos)); }
public void SetUpClipComponent(GameObject sphere) { PlayableClip[] playableClips = sphere.GetComponents <PlayableClip>(); _clipComponent = null; PlayableClip toDelete = null; foreach (PlayableClip playableClip in playableClips) { if (Mathf.Abs(playableClip.startTime - this.start) < 1e-5f && Mathf.Abs(playableClip.endTime - this.end) < 1e-5f) { toDelete = playableClip; MonoBehaviour.DestroyImmediate(toDelete); break; } } _clipComponent = (PlayableClip)sphere.AddComponent(typeof(PlayableClip)); UpdateClipComponent(); }