/// <summary>
    /// Draw the inspector
    /// </summary>
    public override void OnInspectorGUI()
    {
        base.DrawDefaultInspector();

        MultiActorTrackGroup multiActorGroup = base.serializedObject.targetObject as MultiActorTrackGroup;

        //base.serializedObject.Update();

        //EditorGUILayout.PropertyField(actors, actorsContent);

        if (GUILayout.Button(addTrackContent))
        {
            CutsceneControlHelper.ShowAddTrackContextMenu(multiActorGroup);
        }

        if (isShowdic ? GUILayout.Button(noShowdic) : GUILayout.Button(showdic))
        {
            isShowdic = !isShowdic;
        }
        //base.serializedObject.ApplyModifiedProperties();

        if (isShowdic)
        {
            base.OnInspectorGUI();
        }
    }
Пример #2
0
    /// <summary>
    /// Draw the inspector
    /// </summary>
    public override void OnInspectorGUI()
    {
        base.serializedObject.Update();

        ActorTrackGroup actorGroup = base.serializedObject.targetObject as ActorTrackGroup;

        TimelineTrack[] tracks = actorGroup.GetTracks();

        Cutscene cutscene = actorGroup.Cutscene;

        bool isCutsceneActive = false;

        if (cutscene == null)
        {
            EditorGUILayout.HelpBox("Track Group must be a child of a Cutscene in the hierarchy", MessageType.Error);
        }
        else
        {
            isCutsceneActive = !(cutscene.State == Cutscene.CutsceneState.Inactive);
            if (isCutsceneActive)
            {
                EditorGUILayout.HelpBox("Cutscene is Active. Actors cannot be altered at the moment.", MessageType.Info);
            }
        }

        GUI.enabled = !isCutsceneActive;
        EditorGUILayout.PropertyField(actor);
        GUI.enabled = true;

        EditorGUILayout.PropertyField(editorRevert);
        EditorGUILayout.PropertyField(runtimeRevert);
        EditorGUILayout.PropertyField(optimizable);
        if (tracks.Length > 0)
        {
            containerFoldout = EditorGUILayout.Foldout(containerFoldout, tracksContent);
            if (containerFoldout)
            {
                EditorGUI.indentLevel++;

                foreach (TimelineTrack track in tracks)
                {
                    EditorGUILayout.BeginHorizontal();
                    track.name = EditorGUILayout.TextField(track.name);
                    if (GUILayout.Button(inspectorIcon, GUILayout.Width(24)))
                    {
                        Selection.activeObject = track;
                    }
                    EditorGUILayout.EndHorizontal();
                }
                EditorGUI.indentLevel--;
            }
        }
        if (GUILayout.Button(addTrackContent))
        {
            CutsceneControlHelper.ShowAddTrackContextMenu(actorGroup);
        }

        base.serializedObject.ApplyModifiedProperties();
    }
Пример #3
0
    /// <summary>
    /// Draw the inspector
    /// </summary>
    public override void OnInspectorGUI()
    {
        base.serializedObject.Update();

        DirectorGroup directorGroup = base.serializedObject.targetObject as DirectorGroup;

        TimelineTrack[] tracks = directorGroup.GetTracks();


        EditorGUILayout.PropertyField(optimizable);
        if (tracks.Length > 0)
        {
            containerFoldout = EditorGUILayout.Foldout(containerFoldout, tracksContent);
            if (containerFoldout)
            {
                EditorGUI.indentLevel++;
                {
                    var __array1       = tracks;
                    var __arrayLength1 = __array1.Length;
                    for (int __i1 = 0; __i1 < __arrayLength1; ++__i1)
                    {
                        var track = (TimelineTrack)__array1[__i1];
                        {
                            EditorGUILayout.BeginHorizontal();
                            track.name = EditorGUILayout.TextField(track.name);
                            if (GUILayout.Button(inspectorIcon, GUILayout.Width(24)))
                            {
                                Selection.activeObject = track;
                            }
                            EditorGUILayout.EndHorizontal();
                        }
                    }
                }
                EditorGUI.indentLevel--;
            }
        }

        if (GUILayout.Button(addTrackContent))
        {
            CutsceneControlHelper.ShowAddTrackContextMenu(directorGroup);
        }

        base.serializedObject.ApplyModifiedProperties();
    }
Пример #4
0
    /// <summary>
    /// Draw the inspector
    /// </summary>
    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        DirectorGroup directorGroup = serializedObject.targetObject as DirectorGroup;

        TimelineTrack[] tracks = directorGroup.GetTracks();

        EditorGUILayout.PropertyField(optimizable);
        if (tracks.Length > 0)
        {
            containerFoldout = EditorGUILayout.Foldout(containerFoldout, tracksContent);
            if (containerFoldout)
            {
                EditorGUI.indentLevel++;

                foreach (TimelineTrack track in tracks)
                {
                    EditorGUILayout.BeginHorizontal();
                    track.name = EditorGUILayout.TextField(track.name);
                    if (GUILayout.Button(inspectorIcon, GUILayout.Width(24)))
                    {
                        Selection.activeObject = track;
                    }
                    EditorGUILayout.EndHorizontal();
                }
                EditorGUI.indentLevel--;
            }
        }

        if (GUILayout.Button(addTrackContent))
        {
            CutsceneControlHelper.ShowAddTrackContextMenu(directorGroup);
        }

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

        ActorTrackGroup actorGroup = base.serializedObject.targetObject as ActorTrackGroup;

        TimelineTrack[] tracks = actorGroup.GetTracks();

        Cutscene cutscene = actorGroup.Cutscene;

        bool isCutsceneActive = false;

        if (cutscene == null)
        {
            EditorGUILayout.HelpBox("Track Group must be a child of a Cutscene in the hierarchy", MessageType.Error);
        }
        else
        {
            isCutsceneActive = !(cutscene.State == Cutscene.CutsceneState.Inactive);
            if (isCutsceneActive)
            {
                EditorGUILayout.HelpBox("Cutscene is Active. Actors cannot be altered at the moment.", MessageType.Info);
            }
        }

        EditorGUI.BeginChangeCheck();
        GUI.enabled = !isCutsceneActive;
        EditorGUILayout.PropertyField(actor);
        GUI.enabled = true;
        if (EditorGUI.EndChangeCheck())
        {
            if (actor.objectReferenceValue != null)
            {
                actorTag.stringValue = (actor.objectReferenceValue as Transform).tag;
                //CutsceneActor actorComp = (actor.objectReferenceValue as Transform).GetComponent<CutsceneActor>();
                //if (actorComp == null)
                //	actorComp = (actor.objectReferenceValue as Transform).gameObject.AddComponent<CutsceneActor>();
                //actorGUID.stringValue = actorComp.ActorGUID;
            }
            else
            {
                actorTag.stringValue = "";
                //actorGUID.stringValue = "";
            }
        }
        else
        {
            if (actor.objectReferenceValue != null && (string.IsNullOrEmpty(actorTag.stringValue) || actorTag.stringValue.Equals("Untagged") /* || string.IsNullOrEmpty(actorGUID.stringValue)*/))
            {
                actorTag.stringValue = (actor.objectReferenceValue as Transform).tag;
                //CutsceneActor actorComp = (actor.objectReferenceValue as Transform).GetComponent<CutsceneActor>();
                //if (actorComp == null)
                //	actorComp = (actor.objectReferenceValue as Transform).gameObject.AddComponent<CutsceneActor>();
                //actorGUID.stringValue = actorComp.ActorGUID;
            }
        }
        GUI.enabled = false;
        EditorGUILayout.PropertyField(actorTag);
        //EditorGUILayout.PropertyField(actorGUID);
        GUI.enabled = true;

        EditorGUILayout.PropertyField(editorRevert);
        EditorGUILayout.PropertyField(runtimeRevert);
        EditorGUILayout.PropertyField(optimizable);
        if (tracks.Length > 0)
        {
            containerFoldout = EditorGUILayout.Foldout(containerFoldout, tracksContent);
            if (containerFoldout)
            {
                EditorGUI.indentLevel++;

                foreach (TimelineTrack track in tracks)
                {
                    EditorGUILayout.BeginHorizontal();
                    track.name = EditorGUILayout.TextField(track.name);
                    if (GUILayout.Button(inspectorIcon, GUILayout.Width(24)))
                    {
                        Selection.activeObject = track;
                    }
                    EditorGUILayout.EndHorizontal();
                }
                EditorGUI.indentLevel--;
            }
        }
        if (GUILayout.Button(addTrackContent))
        {
            CutsceneControlHelper.ShowAddTrackContextMenu(actorGroup);
        }

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

        ActorTrackGroup actorGroup = base.serializedObject.targetObject as ActorTrackGroup;

        TimelineTrack[] tracks = actorGroup.GetTracks();

        Cutscene cutscene = actorGroup.Cutscene;

        bool isCutsceneActive = false;

        if (cutscene == null)
        {
            EditorGUILayout.HelpBox("Track Group must be a child of a Cutscene in the hierarchy", MessageType.Error);
        }
        else
        {
            isCutsceneActive = !(cutscene.State == Cutscene.CutsceneState.Inactive);
            if (isCutsceneActive)
            {
                EditorGUILayout.HelpBox("Cutscene is Active. Actors cannot be altered at the moment.", MessageType.Info);
            }
        }

        int actorType = this.actorTypeProperty.enumValueIndex;

        ActorTrackGroup.ActorType newActorType = (ActorTrackGroup.ActorType)EditorGUILayout.EnumPopup(new GUIContent("Actor Type"),
                                                                                                      (ActorTrackGroup.ActorType)actorType);
        this.actorTypeProperty.enumValueIndex = (int)newActorType;

        GUI.enabled = !isCutsceneActive;

        if (newActorType == ActorTrackGroup.ActorType.Static)
        {
            EditorGUILayout.PropertyField(actorProperty, new GUIContent("actor"));
        }
        else
        {
            UnityEngine.Object obj = EditorGUILayout.ObjectField(new GUIContent("Asset"), actorProperty.objectReferenceValue, typeof(UnityEngine.Object), false);

            if (obj != null && obj != actorProperty.objectReferenceValue)
            {
                string srcPath  = AssetDatabase.GetAssetPath(obj);
                string fileName = Path.GetFileName(srcPath);

                string destPath = srcPath;
                if (destPath.StartsWith(EFFECT_SRC_PATH))
                {
                    if (!Directory.Exists(GEN_EFFECT_PATH))
                    {
                        Directory.CreateDirectory(GEN_EFFECT_PATH);
                    }

                    destPath = string.Concat(GEN_EFFECT_PATH, fileName);
                    File.Copy(srcPath, destPath, true);
                    AssetDatabase.ImportAsset(destPath);
                    AssetDatabase.Refresh();
                }
                string relativePath = destPath.Replace(RES_PATH, "");
                bool   isGen        = this.assetPathProperty.stringValue != relativePath;
                this.assetPathProperty.stringValue = relativePath;

                if (isGen)
                {
                    Initialize(actorGroup);

                    actorProperty.objectReferenceValue = actorGroup.Actor;
                }
            }
            EditorGUILayout.PropertyField(assetPathProperty);
        }
        GUI.enabled = true;

        EditorGUILayout.PropertyField(optimizable);
        if (tracks.Length > 0)
        {
            containerFoldout = EditorGUILayout.Foldout(containerFoldout, tracksContent);
            if (containerFoldout)
            {
                EditorGUI.indentLevel++;

                foreach (TimelineTrack track in tracks)
                {
                    EditorGUILayout.BeginHorizontal();
                    track.name = EditorGUILayout.TextField(track.name);
                    if (GUILayout.Button(inspectorIcon, GUILayout.Width(24)))
                    {
                        Selection.activeObject = track;
                    }
                    EditorGUILayout.EndHorizontal();
                }
                EditorGUI.indentLevel--;
            }
        }
        if (GUILayout.Button(addTrackContent))
        {
            CutsceneControlHelper.ShowAddTrackContextMenu(actorGroup);
        }

        if (newActorType == ActorTrackGroup.ActorType.Dynamic && GUILayout.Button(reflushEntity))
        {
            Initialize(actorGroup);
        }
        base.serializedObject.ApplyModifiedProperties();
    }
    /// <summary>
    /// Draw the inspector
    /// </summary>
    public override void OnInspectorGUI()
    {
        base.serializedObject.Update();

        EntityTrackGroup actorGroup = base.serializedObject.targetObject as EntityTrackGroup;

        TimelineTrack[] tracks = actorGroup.GetTracks();

        Cutscene cutscene = actorGroup.Cutscene;

        bool isCutsceneActive = false;

        if (cutscene == null)
        {
            EditorGUILayout.HelpBox("Track Group must be a child of a Cutscene in the hierarchy", MessageType.Error);
        }
        else
        {
            isCutsceneActive = !(cutscene.State == Cutscene.CutsceneState.Inactive);
            if (isCutsceneActive)
            {
                EditorGUILayout.HelpBox("Cutscene is Active. Actors cannot be altered at the moment.", MessageType.Info);
            }
        }

        GUI.enabled = !isCutsceneActive;
        EditorGUILayout.PropertyField(selfProperty, new GUIContent("Self"));
        if (!selfProperty.boolValue)
        {
            EditorGUILayout.PropertyField(modelProperty, new GUIContent("Model"));
            EditorGUILayout.PropertyField(wingsProperty, new GUIContent("Wings"));
            EditorGUILayout.PropertyField(weaponProperty, new GUIContent("Weapone"));
            if (!string.IsNullOrEmpty(this.weaponProperty.stringValue))
            {
                EditorGUILayout.PropertyField(weaponPostionProperty, new GUIContent("Weapon Postion"));
                EditorGUILayout.PropertyField(weaponRotationProperty, new GUIContent("Weapone Rotation"));
            }
            //        EditorGUILayout.PropertyField(horseProperty, new GUIContent("Horse"));
        }
        else
        {
            EditorGUILayout.PropertyField(isWeaponProperty, new GUIContent("ShowWeapon"));
        }

        GUI.enabled = true;

        EditorGUILayout.PropertyField(optimizable);
        if (tracks.Length > 0)
        {
            containerFoldout = EditorGUILayout.Foldout(containerFoldout, tracksContent);
            if (containerFoldout)
            {
                EditorGUI.indentLevel++;

                foreach (TimelineTrack track in tracks)
                {
                    EditorGUILayout.BeginHorizontal();
                    track.name = EditorGUILayout.TextField(track.name);
                    if (GUILayout.Button(inspectorIcon, GUILayout.Width(24)))
                    {
                        Selection.activeObject = track;
                    }
                    EditorGUILayout.EndHorizontal();
                }
                EditorGUI.indentLevel--;
            }
        }
        if (GUILayout.Button(addTrackContent))
        {
            CutsceneControlHelper.ShowAddTrackContextMenu(actorGroup);
        }

        base.serializedObject.ApplyModifiedProperties();
        if (GUILayout.Button(reflushEntity))
        {
            Initialize(actorGroup, modelProperty.stringValue, wingsProperty.stringValue, weaponProperty.stringValue, horseProperty.stringValue);
        }
    }