Exemplo n.º 1
0
    /// <summary>
    /// Draw the inspector
    /// </summary>
    public override void OnInspectorGUI()
    {
        base.serializedObject.Update();

        EditorGUILayout.BeginHorizontal();
        //EditorGUILayout.PrefixLabel(new GUIContent("Director"));
        if (GUILayout.Button("Open Director"))
        {
            DirectorWindow window = EditorWindow.GetWindow(typeof(DirectorWindow)) as DirectorWindow;
            window.FocusCutscene(base.serializedObject.targetObject as Cutscene);
        }
        EditorGUILayout.EndHorizontal();



        EditorGUILayout.PropertyField(this.duration, durationContent);
        EditorGUILayout.PropertyField(this.isLooping, loopingContent);
        EditorGUILayout.PropertyField(this.isSkippable, skippableContent);
        EditorGUILayout.PropertyField(this.canOptimize, optimizeContent);
        EditorGUILayout.PropertyField(this.resetPositionOnEnd, resetPositionOnEndContent);

        containerFoldout = EditorGUILayout.Foldout(containerFoldout, groupsContent);

        if (containerFoldout)
        {
            EditorGUI.indentLevel++;
            Cutscene c = base.serializedObject.targetObject as Cutscene;

            for (int i = 0; i < c.TrackGroups.Length; i++)
            {
                TrackGroup container = c.TrackGroups[i];
                EditorGUILayout.BeginHorizontal();

                container.name = EditorGUILayout.TextField(container.name);
                //GUILayout.Button("add", GUILayout.Width(16));
                if (GUILayout.Button(inspectorIcon, GUILayout.Width(24)))
                {
                    Selection.activeObject = container;
                }
                //GUILayout.Button("u", GUILayout.Width(16));
                //GUILayout.Button("d", GUILayout.Width(16));
                EditorGUILayout.EndHorizontal();

                //EditorGUILayout.ObjectField(container.name, container, typeof(TrackGroup), true);
            }
            EditorGUI.indentLevel--;
            if (GUILayout.Button(addGroupContent))
            {
                CutsceneControlHelper.ShowAddTrackGroupContextMenu(c);
            }
        }

        base.serializedObject.ApplyModifiedProperties();
    }
Exemplo n.º 2
0
    /// <summary>
    /// Draw the inspector
    /// </summary>
    public override void OnInspectorGUI()
    {
        base.serializedObject.Update();

        EditorGUILayout.PropertyField(this.duration, durationContent);
        EditorGUILayout.PropertyField(this.isLooping, loopingContent);
        EditorGUILayout.PropertyField(this.isSkippable, skippableContent);
        EditorGUILayout.PropertyField(this.canOptimize, optimizeContent);

        containerFoldout = EditorGUILayout.Foldout(containerFoldout, groupsContent);

        if (containerFoldout)
        {
            EditorGUI.indentLevel++;
            Cutscene c = base.serializedObject.targetObject as Cutscene;
            {
                var __array1       = c.TrackGroups;
                var __arrayLength1 = __array1.Length;
                for (int __i1 = 0; __i1 < __arrayLength1; ++__i1)
                {
                    var container = (TrackGroup)__array1[__i1];
                    {
                        EditorGUILayout.BeginHorizontal();

                        container.name = EditorGUILayout.TextField(container.name);
                        //GUILayout.Button("add", GUILayout.Width(16));
                        if (GUILayout.Button(inspectorIcon, GUILayout.Width(24)))
                        {
                            Selection.activeObject = container;
                        }
                        //GUILayout.Button("u", GUILayout.Width(16));
                        //GUILayout.Button("d", GUILayout.Width(16));
                        EditorGUILayout.EndHorizontal();

                        //EditorGUILayout.ObjectField(container.name, container, typeof(TrackGroup), true);
                    }
                }
            }
            EditorGUI.indentLevel--;
            if (GUILayout.Button(addGroupContent))
            {
                CutsceneControlHelper.ShowAddTrackGroupContextMenu(c);
            }
        }

        base.serializedObject.ApplyModifiedProperties();
    }
Exemplo n.º 3
0
    /// <summary>
    /// Draw the inspector
    /// </summary>
    public override void OnInspectorGUI()
    {
        base.serializedObject.Update();

        EditorGUILayout.BeginHorizontal();
        //EditorGUILayout.PrefixLabel(new GUIContent("Director"));
        if (GUILayout.Button("Open Director"))
        {
            DirectorWindow window = EditorWindow.GetWindow(typeof(DirectorWindow)) as DirectorWindow;
            window.FocusCutscene(base.serializedObject.targetObject as Cutscene);
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.PropertyField(this.debug, debugContent);
        EditorGUILayout.PropertyField(this.duration, durationContent);
        EditorGUILayout.PropertyField(this.isLooping, loopingContent);
        EditorGUILayout.PropertyField(this.isSkippable, skippableContent);
        EditorGUILayout.PropertyField(this.canOptimize, optimizeContent);

        containerFoldout = EditorGUILayout.Foldout(containerFoldout, groupsContent);

        if (containerFoldout)
        {
            EditorGUI.indentLevel++;
            Cutscene c = base.serializedObject.targetObject as Cutscene;

            foreach (TrackGroup container in c.TrackGroups)
            {
                EditorGUILayout.BeginHorizontal();

                container.name = EditorGUILayout.TextField(container.name);
                //GUILayout.Button("add", GUILayout.Width(16));
                if (GUILayout.Button(inspectorIcon, GUILayout.Width(24)))
                {
                    Selection.activeObject = container;
                }
                //GUILayout.Button("u", GUILayout.Width(16));
                //GUILayout.Button("d", GUILayout.Width(16));
                EditorGUILayout.EndHorizontal();

                //EditorGUILayout.ObjectField(container.name, container, typeof(TrackGroup), true);
            }
            EditorGUI.indentLevel--;
            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button(addGroupContent, GUILayout.Width(100)))
            {
                CutsceneControlHelper.ShowAddTrackGroupContextMenu(c);
            }
            EditorGUILayout.EndHorizontal();
        }

        EditorGUILayout.BeginHorizontal();
//        if (GUILayout.Button(reflushEntityContent))
//        {
//            Cutscene cutscene = base.target as Cutscene;
//            EntityTrackGroup[] actorGroupArr = cutscene.GetComponentsInChildren<EntityTrackGroup>();
//
//            foreach (EntityTrackGroup actorGroup in actorGroupArr)
//            {
//                EntityTrackGroupInspector.Initialize(actorGroup, actorGroup.Model,actorGroup.Wings,
//                                                     actorGroup.Weapon, actorGroup.Horse);
//            }
//        }

        if (GUILayout.Button(resetContent))
        {
            Cutscene cutscene = base.target as Cutscene;
            resetCutscene(cutscene);
        }

        if (GUILayout.Button(clearContent))
        {
            clearTrackGroups((Cutscene)base.target);
        }
        EditorGUILayout.EndHorizontal();

        if (GUILayout.Button(exportContent))
        {
            exportPrefab();
        }
        base.serializedObject.ApplyModifiedProperties();
    }