예제 #1
0
        public GameObject GetActor()
        {
            GameObject actor = null;

            if (transform.parent != null)
            {
                CurveTrack track = transform.parent.GetComponentInParent <CurveTrack>();
                if (track != null)
                {
                    Transform actorTransform = track.GetActor();
                    if (actorTransform != null)
                    {
                        actor = actorTransform.gameObject;
                    }
                }
            }
            return(actor);
        }
    internal static CinemaActorClipCurve CreateActorClipCurve(CurveTrack track)
    {
        string name = DirectorHelper.getCutsceneItemName(track.gameObject, CURVE_CLIP_NAME_DEFAULT, typeof(CinemaActorClipCurve));
        GameObject item = new GameObject(name);
        item.transform.parent = track.transform;
        CinemaActorClipCurve clip = item.AddComponent<CinemaActorClipCurve>();

        SortedDictionary<float, CinemaActorClipCurve> sortedItems = new SortedDictionary<float, CinemaActorClipCurve>();
        foreach (CinemaActorClipCurve c in track.TimelineItems)
        {
            sortedItems.Add(c.Firetime, c);
        }

        float latestTime = 0;
        float length = DEFAULT_CURVE_LENGTH;
        foreach (CinemaActorClipCurve c in sortedItems.Values)
        {
            if (latestTime >= c.Firetime)
            {
                latestTime = Mathf.Max(latestTime, c.Firetime + c.Duration);
            }
            else
            {
                length = c.Firetime - latestTime;
                break;
            }
        }

        clip.Firetime = latestTime;
        clip.Duration = length;

        return clip;
    }
 public PasteContext(Vector2 mousePosition, CurveTrack track)
 {
     this.mousePosition = mousePosition;
     this.track = track;
 }
 private void addNewCurveItem(CurveTrack track)
 {
     Undo.RegisterCreatedObjectUndo(CutsceneItemFactory.CreateActorClipCurve(track), "Created Actor Clip Curve");
 }