Example #1
0
        public Transform GetActor()
        {
            ActorTrackGroup component = base.transform.parent.GetComponent <ActorTrackGroup>();

            if (component == null)
            {
                return(null);
            }
            return(component.Actor);
        }
Example #2
0
 static public int get_Actor(IntPtr l)
 {
     try {
         CinemaDirector.ActorTrackGroup self = (CinemaDirector.ActorTrackGroup)checkSelf(l);
         pushValue(l, self.Actor);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #3
0
        /// <summary>
        /// Get the Actor associated with this track. Can return null.
        /// </summary>
        public Transform GetActor()
        {
            ActorTrackGroup atg = this.GetTrackGroup() as ActorTrackGroup;

            if (atg == null)
            {
                Debug.LogError("No ActorTrackGroup found on parent.", this);
                return(null);
            }
            return(atg.Actor);
        }
Example #4
0
 static public int constructor(IntPtr l)
 {
     try {
         CinemaDirector.ActorTrackGroup o;
         o = new CinemaDirector.ActorTrackGroup();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #5
0
 static public int set_Actor(IntPtr l)
 {
     try {
         CinemaDirector.ActorTrackGroup self = (CinemaDirector.ActorTrackGroup)checkSelf(l);
         UnityEngine.Transform          v;
         checkType(l, 2, out v);
         self.Actor = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #6
0
        public override void Stop()
        {
            if (_state)
            {
                if (_state.time >= _state.length)
                {
                    return;
                }
                if (_state.time != _state.length)
                {
                    _state.time = _state.length;
                }
            }
            else
            {
                ActorTrackGroup atg = GetComponentInParent <ActorTrackGroup>();
                if (!atg)
                {
                    return;
                }
                if (!atg.Actor)
                {
                    return;
                }
                Animation animation = atg.Actor.GetComponent <Animation>();
                if (!animation)
                {
                    return;
                }

                if (!animationClip)
                {
                    return;
                }

                string         clipname = animationClip.name;
                AnimationState state    = animation[clipname];
                if (_state == null)
                {
                    animation.AddClip(animationClip, clipname);
                    state = animation[clipname];
                }
                animation.wrapMode = wrapMode;
                if (state != null)
                {
                    state.time = state.length;
                }
                animation.Play(clipname);
            }
            base.Stop();
        }
Example #7
0
        /// <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 CurveTrack CreateCurveTrack(ActorTrackGroup trackGroup)
 {
     GameObject curveTrackGO = new GameObject(CURVE_TRACK_LABEL, typeof(CurveTrack));
     curveTrackGO.transform.parent = trackGroup.transform;
     return curveTrackGO.GetComponent<CurveTrack>();
 }
 internal static ActorItemTrack CreateActorItemTrack(ActorTrackGroup trackGroup)
 {
     GameObject eventTrackGO = new GameObject(EVENT_TRACK_LABEL, typeof(ActorItemTrack));
     eventTrackGO.transform.parent = trackGroup.transform;
     return eventTrackGO.GetComponent<ActorItemTrack>();
 }