public static void Draw(InViewTimeline timeline)
    {
        GUILayout.Label("Timeline Settings", InViewTimelineEditorStyles.GetHeader());

        timeline.TriggerZoneCentre   = EditorGUILayout.Vector3Field("Trigger Zone Centre", timeline.TriggerZoneCentre);
        timeline.TriggerZoneSize     = EditorGUILayout.Vector3Field("Trigger Zone Size", timeline.TriggerZoneSize);
        timeline.LastInViewThreshold = EditorGUILayout.FloatField("Last in View Threshold", timeline.LastInViewThreshold);
        EditorGUILayout.HelpBox("Seconds that a timeline will be still considered in view after the user has looked away. 0 being the user must be looking at the timeline to continue.", MessageType.Info);

        timeline.Animator = (Animator)EditorGUILayout.ObjectField("Target Animator", timeline.Animator, typeof(Animator), true);
        EditorGUILayout.HelpBox("Target Animator for this timeline. If one isn't selected the timeline will search for an Animator attached to it.", MessageType.Info);
    }
    public static void Draw(InViewTimeline timeline)
    {
        GUILayout.Label("Timeline Info", InViewTimelineEditorStyles.GetHeader());

        if (timeline.IsInView())
        {
            GUILayout.Label(GetViewStatusText(timeline.IsInView()), InViewTimelineEditorStyles.GetInView());
            GUILayout.Label(GetLastInViewText(timeline.GetLastInViewTimestamp()), InViewTimelineEditorStyles.GetInView());
        }
        else
        {
            GUILayout.Label(GetViewStatusText(timeline.IsInView()), InViewTimelineEditorStyles.GetOutOfView());
            GUILayout.Label(GetLastInViewText(timeline.GetLastInViewTimestamp()), InViewTimelineEditorStyles.GetOutOfView());
        }
    }
    public static void Draw(int index, InViewTimeline timeline)
    {
        var suffix = "";

        if (index == timeline.GetActiveBlockIndex())
        {
            suffix += " [ACTIVE]";
        }

        GUILayout.BeginVertical(EditorStyles.helpBox);
        GUILayout.BeginHorizontal();
        GUILayout.Label($"Block #{index + 1}{suffix}", InViewTimelineEditorStyles.GetHeader(), GUILayout.ExpandWidth(true));

        if (index > 0)
        {
            if (GUILayout.Button("Up", GUILayout.Width(30)))
            {
                timeline.MoveUp(index);

                return;
            }
        }

        if (index < timeline.Blocks.Count - 1)
        {
            if (GUILayout.Button("Down", GUILayout.Width(50)))
            {
                timeline.MoveDown(index);

                return;
            }
        }

        if (GUILayout.Button("X", GUILayout.Width(25)))
        {
            timeline.RemoveBlock(index);

            return;
        }

        GUILayout.EndHorizontal();
    }
Beispiel #4
0
    public static void Draw(int index, InViewTimelineBlock block)
    {
        var suffix = "";

        GUILayout.BeginVertical(EditorStyles.helpBox);
        GUILayout.BeginHorizontal();
        GUILayout.Label($"Action #{index + 1}{suffix}", InViewTimelineEditorStyles.GetHeader(), GUILayout.ExpandWidth(true));

        if (index > 0)
        {
            if (GUILayout.Button("Up", GUILayout.Width(30)))
            {
                block.MoveUp(index);

                return;
            }
        }

        if (index < block.Actions.Count - 1)
        {
            if (GUILayout.Button("Down", GUILayout.Width(50)))
            {
                block.MoveDown(index);

                return;
            }
        }

        if (GUILayout.Button("X", GUILayout.Width(25)))
        {
            block.RemoveAction(index);

            return;
        }

        GUILayout.EndHorizontal();
    }
 public static void Draw()
 {
     GUILayout.Label("Timeline Blocks", InViewTimelineEditorStyles.GetHeader());
 }