/// <summary> /// Get the Actors associated with this track. Can return null. /// In the case of MultiActors it will return the full list. /// </summary> // public List<Transform> Actors // { // get // { // ActorTrackGroup trackGroup = TrackGroup as ActorTrackGroup; // if (trackGroup != null) // { // List<Transform> actors = new List<Transform>() { }; // actors.Add(trackGroup.Actor); // return actors; // } // // MultiActorTrackGroup multiActorTrackGroup = TrackGroup as MultiActorTrackGroup; // if (multiActorTrackGroup != null) // { // return multiActorTrackGroup.Actors; // } // return null; // } // } public bool GetActors(ref List <Transform> actorList) { actorList.Clear(); TrackGroup thisTrackGroup = this.GetTrackGroup(); ActorTrackGroup trackGroup = thisTrackGroup as ActorTrackGroup; if (trackGroup != null) { actorList.Add(trackGroup.Actor); return(true); } MultiActorTrackGroup multiActorTrackGroup = thisTrackGroup as MultiActorTrackGroup; if (multiActorTrackGroup != null) { actorList.AddRange(multiActorTrackGroup.Actors); return(true); } return(false); }
internal static MultiCurveTrack CreateMultiActorCurveTrack(MultiActorTrackGroup trackGroup) { GameObject curveTrackGO = new GameObject(CURVE_TRACK_LABEL, typeof(MultiCurveTrack)); curveTrackGO.transform.parent = trackGroup.transform; return curveTrackGO.GetComponent<MultiCurveTrack>(); }
internal static ActorItemTrack CreateActorItemTrack(MultiActorTrackGroup trackGroup) { GameObject eventTrackGO = new GameObject(EVENT_TRACK_LABEL, typeof(ActorItemTrack)); eventTrackGO.transform.parent = trackGroup.transform; return eventTrackGO.GetComponent<ActorItemTrack>(); }