Esempio n. 1
0
 public static void ShowOpenView()
 {
     SceneEditor sceneEditor = ScriptableObject.CreateInstance<SceneEditor>();
     sceneEditor.name = "DungeonOpenView";
     sceneEditor.minSize = new Vector2(600f, 300f);
     SceneView.onSceneGUIDelegate = (SceneView.OnSceneFunc)Delegate.Combine(SceneView.onSceneGUIDelegate, new SceneView.OnSceneFunc(sceneEditor.SceneUpdate));
 }
Esempio n. 2
0
 static void AddWindow()
 {
     //创建窗口
     //_this = (SceneEditor)EditorWindow.GetWindowWithRect (typeof (SceneEditor),wr,false,EditorStringConfig.getString(10028));
     _this = EditorWindow.GetWindow <SceneEditor>(EditorStringConfig.getString(10028), true);
     _this.Show();
 }
Esempio n. 3
0
    private static void SceneEditorMethod()
    {
        parentTransform = GameObject.Find("MapRoot").transform;
        SceneEditor sceneEditor = EditorWindow.GetWindow <SceneEditor>();

        sceneEditor.Show();
        selectObjects = Selection.gameObjects;
        typeArr       = new int[selectObjects.Length];
    }
Esempio n. 4
0
        public EditorGridController(SceneEditor editor)
        {
            Editor               = editor;
            StartingTransforms   = new List <TransformComponent>();
            MovedMouseSinceStart = false;

            SharedPivotRotationMode = true;

            UpdateAlignmentValues();
        }
        public void OnSetMainTask(string strMainTaskID)
        {
            curMainTask?.SetIsMainTask(false);
            ITaskEditorView view = SceneEditor.GetTaskEditor(strMainTaskID)?.view;

            if (view != null)
            {
                curMainTask = view as UITaskItem;
            }
            curMainTask?.SetIsMainTask(true);
        }
Esempio n. 6
0
        public bool Init(string filename, IAtlIEKSceneEditorDocLogical DocLogical, SceneEditor sceneeditor)
        {
            m_strFileName = filename;
            m_DocLogical  = DocLogical;
            m_SceneEditor = sceneeditor;

            if (m_DocLogical == null)
            {
                return(false);
            }

            int nTreeChildNodesCount = ReloadTree();

            string strFilePath = m_strFileName;

            strFilePath = strFilePath + ".Logical";
            StringBuilder sb = new StringBuilder(1024);

            Helper.ReadIniFile("MAIN", "CheckReliveEnable", "true", sb, 1024, strFilePath);
            if (sb.ToString() == "true")
            {
                m_bCheck = true;
            }
            else
            {
                m_bCheck = false;
            }
            //if (strcmp(szFileName, "²âÊÔ") == 0)
            //{
            //    strcat(szFileName, "1");
            //}
            //else if (strcmp(szFileName, "¹â") == 0)
            //{
            //    strcpy(szFileName, "²âÊÔ1");
            //}
            //else if (strcmp(szFileName, "µÇ½½çÃ泡¾°") == 0)
            //{
            //    strcpy(szFileName, "µÇ½½çÃæ");
            //}
            CK_Run.Checked = m_bCheck;

            if (m_bCheck && (nTreeChildNodesCount > 0))
            {
                this.Show();
            }

            return(true);
        }
        public void TestPutObjectsTool()
        {
            SceneEditor editor = new SceneEditor(new EditorScene());

            PutObjectsTool tool = new PutObjectsTool(editor);

            EditorObject eObj = new EditorObject();

            eObj.AddMeshFromCollada(COLLADA.FromStream(ColladaFiles.GetPyramid001DAE()));
            eObj.Name = "Wall001";
            //eObj.Save();

            tool.SelectedPutObject = eObj;

            editor.ActivateTool(tool);

            // SceneEditorTest.RunSceneEditorTestEnvironment(editor);
        }
Esempio n. 8
0
        public static SimpleEditorViewModel Create(IXNAGame game, SceneEditor editor, SimpleEditorForm form)
        {
            var vm = new SimpleEditorViewModel();

            vm.editor      = editor;
            vm.form        = form;
            vm.Select      = new DelegateCommand(o => game.InvokeUpdate(editor.EnableSelectMod));
            vm.PlaceEntity = new DelegateCommand(o => game.InvokeUpdate(editor.EnablePlaceEntityMode));
            vm.form.cAssignScript.Click += delegate { game.InvokeUpdate(() => editor.AssignScriptToSelected(vm.SelectedScript.FileInfo)); };

            var t = new Thread(vm.pollJob);

            t.IsBackground = true;
            t.Name         = "SimpleEditorViewModelPoll";
            t.Start();

            return(vm);
        }
Esempio n. 9
0
        public bool Init(string filename, IAtlIEKSceneEditorDocLogical DocLogical, SceneEditor sceneeditor)
        {
            m_strFileName = filename;
            m_DocLogical = DocLogical;
            m_SceneEditor = sceneeditor;

            if (m_DocLogical == null)
                return false;
            
            int nTreeChildNodesCount = ReloadTree();

            string strFilePath = m_strFileName;
            strFilePath = strFilePath + ".Logical";
            StringBuilder sb = new StringBuilder(1024);
            Helper.ReadIniFile("MAIN", "CheckReliveEnable", "true", sb, 1024, strFilePath);
            if (sb.ToString() == "true")
            {
                m_bCheck = true;
            }
            else
            {
                m_bCheck = false;
            }
            //if (strcmp(szFileName, "²âÊÔ") == 0)
            //{
            //    strcat(szFileName, "1");
            //}
            //else if (strcmp(szFileName, "¹â") == 0)
            //{
            //    strcpy(szFileName, "²âÊÔ1");
            //}
            //else if (strcmp(szFileName, "µÇ½½çÃ泡¾°") == 0)
            //{
            //    strcpy(szFileName, "µÇ½½çÃæ");
            //}
            CK_Run.Checked = m_bCheck;

            if (m_bCheck && (nTreeChildNodesCount > 0))
            {
                this.Show();
            }

            return true;
        }
Esempio n. 10
0
        public Preview(int regionW, int regionH, SceneEditor sceneSceneEditor, float logicwidth, float logicheight, float middlemapstartx, float middlemapstarty, float logicxstart, float logiczstart)
        {
            InitializeComponent();
            m_panel1 = panel1;

            this.logicWidth = logicwidth;
            this.logicHeight = logicheight;
            this.middlemapStartX = middlemapstartx;
            this.middlemapStartY = middlemapstarty;
            this.SceneSceneEditor = sceneSceneEditor;

            m_panel1.SceneSceneEditor = sceneSceneEditor;
            m_panel1.logicWidth = logicWidth;
            m_panel1.logicHeight = logicHeight;
            m_panel1.middlemapStartX = middlemapstartx;
            m_panel1.middlemapStartY = middlemapstarty;
            m_panel1.logicXStart = logicxstart;
            m_panel1.logicZStart = logiczstart;
            
            //m_parentFrm = parentFrm;
            m_mapRegionW = regionW;
            m_mapRegionH = regionH;
        }
Esempio n. 11
0
        public static void Initialize()
        {
            Global.Config.NoRendering      = true;
            SavedWorkingDirectory          = Global.Config.WorkingDirectory;
            Global.Config.WorkingDirectory = "Content/";

            Engine = new EngineCore();
            Engine.Initialize("Ryne");

            Editor = new SceneEditor(Engine.StateManager);

            var unitTestSceneFile = "Scenes/UnitTestScene/UnitTestScene.fls";
            var unitTestDirectory = new FileInfo(Global.Config.WorkingDirectory + unitTestSceneFile).DirectoryName;

            if (Directory.Exists(unitTestDirectory))
            {
                Directory.Delete(unitTestDirectory, true);
            }

            Editor.NewScene("UnitTestScene");
            Engine.StateManager.Add(Editor);
            Engine.Update(0.0f);
        }
Esempio n. 12
0
        public Preview(int regionW, int regionH, SceneEditor sceneSceneEditor, float logicwidth, float logicheight, float middlemapstartx, float middlemapstarty, float logicxstart, float logiczstart)
        {
            InitializeComponent();
            m_panel1 = panel1;

            this.logicWidth       = logicwidth;
            this.logicHeight      = logicheight;
            this.middlemapStartX  = middlemapstartx;
            this.middlemapStartY  = middlemapstarty;
            this.SceneSceneEditor = sceneSceneEditor;

            m_panel1.SceneSceneEditor = sceneSceneEditor;
            m_panel1.logicWidth       = logicWidth;
            m_panel1.logicHeight      = logicHeight;
            m_panel1.middlemapStartX  = middlemapstartx;
            m_panel1.middlemapStartY  = middlemapstarty;
            m_panel1.logicXStart      = logicxstart;
            m_panel1.logicZStart      = logiczstart;

            //m_parentFrm = parentFrm;
            m_mapRegionW = regionW;
            m_mapRegionH = regionH;
        }
Esempio n. 13
0
 public TopViewForm(BaseForm baseForm)
 {
     InitializeComponent();
     m_BaseForm = baseForm;
     SceneSceneEditor = m_BaseForm.SceneSceneEditor;
 }
Esempio n. 14
0
    static void AddWindow()
    {
        SceneEditor saveWindow = (SceneEditor)EditorWindow.GetWindow(typeof(SceneEditor));

        saveWindow.Show();
    }
Esempio n. 15
0
        public EditorInputMapping(SceneEditor editor, float moveSpeed = 10.0f, float mouseSensitivity = 10.0f)
        {
            // Movement controls
            AddInput(new KeyInput {
                Key = RyneKey.W, Type = InputType.Down, Action = new InputMovementAction(new Float3(1, 0, 0), moveSpeed)
            });
            AddInput(new KeyInput {
                Key = RyneKey.S, Type = InputType.Down, Action = new InputMovementAction(new Float3(-1, 0, 0), moveSpeed)
            });
            AddInput(new KeyInput {
                Key = RyneKey.A, Type = InputType.Down, Action = new InputMovementAction(new Float3(0, -1, 0), moveSpeed)
            });
            AddInput(new KeyInput {
                Key = RyneKey.D, Type = InputType.Down, Action = new InputMovementAction(new Float3(0, 1, 0), moveSpeed)
            });
            AddInput(new KeyInput {
                Key = RyneKey.Q, Type = InputType.Down, Action = new InputMovementAction(new Float3(0, 0, -1), moveSpeed)
            });
            AddInput(new KeyInput {
                Key = RyneKey.E, Type = InputType.Down, Action = new InputMovementAction(new Float3(0, 0, 1), moveSpeed)
            });

            // View controls
            AddInput(new MouseAxisInput {
                Axis = new Float2(1, 0), Action = new InputRotationAction(new Float3(1, 0, 0), mouseSensitivity)
            });
            AddInput(new MouseAxisInput {
                Axis = new Float2(0, 1), Action = new InputRotationAction(new Float3(0, 1, 0), mouseSensitivity, true)
            });

            // FOV controls
            AddInput(new KeyInput {
                Key = RyneKey.C, Type = InputType.Down, Action = new FovInputAction(-10.0f)
            });
            AddInput(new KeyInput {
                Key = RyneKey.Z, Type = InputType.Down, Action = new FovInputAction(10.0f)
            });

            // Edit mode shortcuts
            AddInput(new KeyInput {
                Key = RyneKey.T, Type = InputType.Released, Action = new InputDelegateAction(() => editor.ChangeEditMode(EditMode.Translate))
            });
            AddInput(new KeyInput {
                Key = RyneKey.R, Type = InputType.Released, Action = new InputDelegateAction(() => editor.ChangeEditMode(EditMode.Rotate))
            });
            AddInput(new KeyInput {
                Key = RyneKey.S, Type = InputType.Released, Action = new InputDelegateAction(() => editor.ChangeEditMode(EditMode.Scale))
            });

            // Edit axis shortcuts
            AddInput(new KeyInput {
                Key = RyneKey.X, Type = InputType.Released, Action = new InputDelegateAction(() => editor.ChangeEditAxis(EditAxis.X))
            });
            AddInput(new KeyInput {
                Key = RyneKey.Y, Type = InputType.Released, Action = new InputDelegateAction(() => editor.ChangeEditAxis(EditAxis.Y))
            });
            AddInput(new KeyInput {
                Key = RyneKey.Z, Type = InputType.Released, Action = new InputDelegateAction(() => editor.ChangeEditAxis(EditAxis.Z))
            });

            // Scroll wheel changes movement speed
            AddInput(new MouseScrollInput
            {
                Key    = RyneMouseWheel.WheelUp,
                Action = new InputDelegateAction(() =>
                {
                    foreach (var keyInput in KeyInputs)
                    {
                        if (keyInput.Action.GetType() == typeof(InputMovementAction))
                        {
                            ((InputMovementAction)keyInput.Action).Length *= 1.1f;
                        }
                    }
                })
            });
            AddInput(new MouseScrollInput
            {
                Key    = RyneMouseWheel.WheelDown,
                Action = new InputDelegateAction(() =>
                {
                    foreach (var keyInput in KeyInputs)
                    {
                        if (keyInput.Action.GetType() == typeof(InputMovementAction))
                        {
                            ((InputMovementAction)keyInput.Action).Length /= 1.1f;
                        }
                    }
                })
            });


            // Edit Gui hide
            AddInput(new KeyInput {
                Key = RyneKey.H, Type = InputType.Released, Action = new InputDelegateAction(editor.HideGui)
            });

            // Printscreen renders to image
            AddInput(new KeyInput {
                Key      = RyneKey.PrintScreen, Type = InputType.Released
                , Action = new InputDelegateAction(() => editor.RenderScreenToImage("Renders/Render" + ++editor.Gui.RenderCount + ".tga"))
            });

            // Rename
            AddInput(new KeyInput {
                Key = RyneKey.F2, Type = InputType.Released, Action = new InputDelegateAction(editor.TryRenameEntity)
            });


            // Delete
            AddInput(new KeyInput {
                Key = RyneKey.Delete, Type = InputType.Pressed, Action = new InputDelegateAction(() => editor.DeleteActiveEntities())
            });

            // Copy
            AddInput(new ComboKeyInput
            {
                Key1         = RyneKey.LeftControl, Key2 = RyneKey.C, Type1 = InputType.Down, Type2 = InputType.Pressed,
                Action       = new InputDelegateAction(editor.CopySelectedEntities),
                ConsumeInput = true
            });
            // Paste
            AddInput(new ComboKeyInput
            {
                Key1         = RyneKey.LeftControl, Key2 = RyneKey.V, Type1 = InputType.Down, Type2 = InputType.Pressed,
                Action       = new InputDelegateAction(editor.PasteSelectedEntities),
                ConsumeInput = true
            });
            // Undo
            AddInput(new ComboKeyInput
            {
                Key1         = RyneKey.LeftControl, Key2 = RyneKey.Z, Type1 = InputType.Down, Type2 = InputType.Pressed,
                Action       = new InputDelegateAction(editor.UndoLastAction),
                ConsumeInput = true
            });
            // Save
            AddInput(new ComboKeyInput
            {
                Key1         = RyneKey.LeftControl, Key2 = RyneKey.S, Type1 = InputType.Down, Type2 = InputType.Pressed,
                Action       = new InputDelegateAction(editor.SaveScene),
                ConsumeInput = true
            });
            // Open
            AddInput(new ComboKeyInput
            {
                Key1   = RyneKey.RightControl, Key2 = RyneKey.O, Type1 = InputType.Down, Type2 = InputType.Pressed,
                Action = new InputDelegateAction(() =>
                {
                    var window       = new FileExplorerGui(editor.Gui, "Scenes", ".fls", "Load scene");
                    window.Callback += result =>
                    {
                        var fileName  = ((FileExplorerGui)result).SelectedFile;
                        var sceneName = Path.GetFileNameWithoutExtension(fileName);
                        editor.LoadScene(sceneName);
                    };
                    editor.Gui.AddPopup(window);
                }),
                ConsumeInput = true
            });

            // Right mouse triggers the start and end of camera movement
            AddInput(new MouseInput
            {
                Key    = RyneMouse.Button1,
                Type   = InputType.Pressed,
                Action = new InputControllerAction(controller =>
                {
                    if (!editor.Gui.IsMouseInGui())
                    {
                        controller.SetCaptureMouse(true);
                    }
                })
            });
            AddInput(new MouseInput
            {
                Key    = RyneMouse.Button1,
                Type   = InputType.Released,
                Action = new InputControllerAction(controller => { controller.SetCaptureMouse(false); })
            });
        }
 public void AddTestTask()
 {
     SceneEditor.AddTask(typeof(TaskChain));
 }
Esempio n. 17
0
 public SceneData(SceneEditor editor)
 {
     Editor          = editor;
     BackgroundHdri  = "";
     DeletedEntities = new List <string>();
 }
Esempio n. 18
0
 public TopViewForm(BaseForm baseForm)
 {
     InitializeComponent();
     m_BaseForm       = baseForm;
     SceneSceneEditor = m_BaseForm.SceneSceneEditor;
 }