コード例 #1
0
        private void Awake()
        {
            //得到组件
            model         = GameObject.FindWithTag("Player");
            animator      = model.GetComponent <Animator>();
            cc            = model.GetComponent <CharacterController>();
            pi            = ScriptTool.GetScript <PlayerInput>("_Player");
            cameraControl = ScriptTool.GetScript <CameraControl>("_Camera");

            RegisterFSMEvents();

            //控制Root Motion
            model.GetComponent <RootMotionControl>().RMUpdateEvent += OnRMUpdate;
        }
コード例 #2
0
        private void Awake()
        {
            //使鼠标不可见
            Cursor.visible    = false;
            _LockIcon.enabled = false;

            model = GameObject.FindWithTag("Player");
            pi    = ScriptTool.GetScript <PlayerInput>("_Player");

            mainCamera = Camera.main;
            if (mainCamera == null)
            {
                throw new NullReferenceException("空引用:" + nameof(mainCamera));
            }
            cameraOffset     = mainCamera.transform.parent.gameObject;
            cameraRotation_X = cameraOffset.transform.parent.gameObject;
            cameraRotation_Y = cameraRotation_X.transform.parent.gameObject;

            tempEulerX = 20;
        }
コード例 #3
0
ファイル: EditorDockFactory.cs プロジェクト: bamfbamf/Core2D
        /// <inheritdoc/>
        public override IDock CreateLayout()
        {
            // Documents

            var pageDocument = new PageDocument
            {
                Id    = nameof(PageDocument),
                Title = "Page"
            };

            // Tools

            var projectTool = new ProjectTool
            {
                Id    = nameof(ProjectTool),
                Title = "Project"
            };

            var optionsTool = new OptionsTool
            {
                Id    = nameof(OptionsTool),
                Title = "Options"
            };

            var imagesTool = new ImagesTool
            {
                Id    = nameof(ImagesTool),
                Title = "Images"
            };

            var groupsTool = new GroupsTool
            {
                Id    = nameof(GroupsTool),
                Title = "Groups"
            };

            var databasesTool = new DatabasesTool
            {
                Id    = nameof(DatabasesTool),
                Title = "Databases"
            };

            var scriptTool = new ScriptTool
            {
                Id    = nameof(ScriptTool),
                Title = "Script"
            };

            var browserTool = new BrowserTool
            {
                Id    = nameof(BrowserTool),
                Title = "Browser"
            };

            var stylesTool = new StylesTool
            {
                Id    = nameof(StylesTool),
                Title = "Styles"
            };

            var templatesTool = new TemplatesTool
            {
                Id    = nameof(TemplatesTool),
                Title = "Templates"
            };

            var containerTool = new ContainerTool
            {
                Id    = nameof(ContainerTool),
                Title = "Container"
            };

            var zoomTool = new ZoomTool
            {
                Id    = nameof(ZoomTool),
                Title = "Zoom"
            };

            var shapeTool = new ShapeTool
            {
                Id    = nameof(ShapeTool),
                Title = "Shape"
            };

            var toolsTool = new ToolsTool
            {
                Id    = nameof(ToolsTool),
                Title = "Tools"
            };

            var dataTool = new DataTool
            {
                Id    = nameof(DataTool),
                Title = "Data"
            };

            var styleTool = new StyleTool
            {
                Id    = nameof(StyleTool),
                Title = "Style"
            };

            var templateTool = new TemplateTool
            {
                Id    = nameof(TemplateTool),
                Title = "Template"
            };

            // Panes

            var leftPane = new LayoutDock
            {
                Id          = nameof(ILayoutDock),
                Title       = "EditorLeft",
                Orientation = Orientation.Vertical,
                Proportion  = 0.17,
                CurrentView = null,
                Views       = new ObservableCollection <IView>
                {
                    new ToolDock
                    {
                        Id          = nameof(IToolDock),
                        Title       = "EditorLeftTop",
                        Proportion  = double.NaN,
                        CurrentView = projectTool,
                        Views       = new ObservableCollection <IView>
                        {
                            projectTool,
                            optionsTool,
                            imagesTool
                        }
                    },
                    new SplitterDock()
                    {
                        Id    = nameof(ISplitterDock),
                        Title = "LeftTopSplitter"
                    },
                    new ToolDock
                    {
                        Id          = nameof(IToolDock),
                        Title       = "EditorLeftBottom",
                        Proportion  = double.NaN,
                        CurrentView = groupsTool,
                        Views       = new ObservableCollection <IView>
                        {
                            groupsTool,
                            databasesTool,
                            scriptTool,
                            browserTool
                        }
                    }
                }
            };

            var rightPane = new LayoutDock
            {
                Id          = nameof(ILayoutDock),
                Title       = "EditorRight",
                Orientation = Orientation.Vertical,
                Proportion  = 0.17,
                CurrentView = null,
                Views       = new ObservableCollection <IView>
                {
                    new ToolDock
                    {
                        Id          = nameof(IToolDock),
                        Title       = "EditorRightTop",
                        Proportion  = double.NaN,
                        CurrentView = stylesTool,
                        Views       = new ObservableCollection <IView>
                        {
                            stylesTool,
                            templatesTool,
                            containerTool,
                            zoomTool
                        }
                    },
                    new SplitterDock()
                    {
                        Id    = nameof(ISplitterDock),
                        Title = "RightTopSplitter"
                    },
                    new ToolDock
                    {
                        Id          = nameof(IToolDock),
                        Title       = "EditorRightBottom",
                        Proportion  = double.NaN,
                        CurrentView = shapeTool,
                        Views       = new ObservableCollection <IView>
                        {
                            shapeTool,
                            toolsTool,
                            dataTool,
                            styleTool,
                            templateTool
                        }
                    }
                }
            };

            var documentsPane = new DocumentDock
            {
                Id          = nameof(IDocumentDock),
                Title       = "DocumentsPane",
                Proportion  = double.NaN,
                CurrentView = pageDocument,
                Views       = new ObservableCollection <IView>
                {
                    pageDocument
                }
            };

            // Editor

            var editorLayout = new LayoutDock
            {
                Id          = nameof(ILayoutDock),
                Title       = "EditorLayout",
                Orientation = Orientation.Horizontal,
                Proportion  = double.NaN,
                CurrentView = null,
                Views       = new ObservableCollection <IView>
                {
                    leftPane,
                    new SplitterDock()
                    {
                        Id    = nameof(ISplitterDock),
                        Title = "LeftSplitter"
                    },
                    documentsPane,
                    new SplitterDock()
                    {
                        Id    = nameof(ISplitterDock),
                        Title = "RightSplitter"
                    },
                    rightPane
                }
            };

            // Views

            var editorView = new EditorView
            {
                Id          = nameof(EditorView),
                Title       = "Editor",
                CurrentView = editorLayout,
                Views       = new ObservableCollection <IView>
                {
                    editorLayout
                }
            };

            var aboutView = new AboutView
            {
                Id    = nameof(AboutView),
                Title = "About"
            };

            var browserView = new BrowserView
            {
                Id    = nameof(BrowserView),
                Title = "Browser"
            };

            var scriptView = new ScriptView
            {
                Id    = nameof(ScriptView),
                Title = "Script"
            };

            var documentView = new DocumentView
            {
                Id    = nameof(DocumentView),
                Title = "Document"
            };

            var dashboardView = new DashboardView
            {
                Id    = nameof(DashboardView),
                Title = "Dashboard"
            };

            // Root

            var layout = new RootDock
            {
                Id          = nameof(IRootDock),
                Title       = "Root",
                CurrentView = dashboardView,
                DefaultView = dashboardView,
                Views       = new ObservableCollection <IView>
                {
                    dashboardView,
                    editorView,
                    aboutView,
                    browserView,
                    scriptView,
                    documentView
                }
            };

            return(layout);
        }
コード例 #4
0
 //脚本自动调用
 void GetThisScriptTool(MvToolBase tool)
 {
     ThisScriptTool
         = tool as ScriptTool;
 }
コード例 #5
0
        /// <inheritdoc/>
        public override DM.IDock CreateLayout()
        {
            // Documents

            var pageDocument = new PageDocument
            {
                Id    = nameof(PageDocument),
                Title = "Page"
            };

            // Tools

            var projectTool = new ProjectTool
            {
                Id    = nameof(ProjectTool),
                Title = "Project"
            };

            var optionsTool = new OptionsTool
            {
                Id    = nameof(OptionsTool),
                Title = "Options"
            };

            var imagesTool = new ImagesTool
            {
                Id    = nameof(ImagesTool),
                Title = "Images"
            };

            var groupsTool = new GroupsTool
            {
                Id    = nameof(GroupsTool),
                Title = "Groups"
            };

            var databasesTool = new DatabasesTool
            {
                Id    = nameof(DatabasesTool),
                Title = "Databases"
            };

            var scriptTool = new ScriptTool
            {
                Id    = nameof(ScriptTool),
                Title = "Script"
            };

            var exportTool = new ExportTool
            {
                Id    = nameof(ExportTool),
                Title = "Export"
            };

            var browserTool = new BrowserTool
            {
                Id    = nameof(BrowserTool),
                Title = "Browser"
            };

            var documentTool = new DocumentTool
            {
                Id    = nameof(DocumentTool),
                Title = "Document"
            };

            var stylesTool = new StylesTool
            {
                Id    = nameof(StylesTool),
                Title = "Styles"
            };

            var templatesTool = new TemplatesTool
            {
                Id    = nameof(TemplatesTool),
                Title = "Templates"
            };

            var scriptsTool = new ScriptsTool
            {
                Id    = nameof(ScriptsTool),
                Title = "Scripts"
            };

            var containerTool = new ContainerTool
            {
                Id    = nameof(ContainerTool),
                Title = "Container"
            };

            var zoomTool = new ZoomTool
            {
                Id    = nameof(ZoomTool),
                Title = "Zoom"
            };

            var rendererTool = new RendererTool
            {
                Id    = nameof(RendererTool),
                Title = "Renderer"
            };

            var shapeTool = new ShapeTool
            {
                Id    = nameof(ShapeTool),
                Title = "Shape"
            };

            var toolsTool = new ToolsTool
            {
                Id    = nameof(ToolsTool),
                Title = "Tools"
            };

            var recordTool = new RecordTool
            {
                Id    = nameof(RecordTool),
                Title = "Record"
            };

            var propertiesTool = new PropertiesTool
            {
                Id    = nameof(PropertiesTool),
                Title = "Properties"
            };

            var styleTool = new StyleTool
            {
                Id    = nameof(StyleTool),
                Title = "Style"
            };

            var templateTool = new TemplateTool
            {
                Id    = nameof(TemplateTool),
                Title = "Template"
            };

            // Panes

            var leftPane = new DMC.ProportionalDock
            {
                Id               = nameof(DMC.IProportionalDock),
                Title            = "EditorLeft",
                Orientation      = DM.Orientation.Vertical,
                Proportion       = 0.17,
                ActiveDockable   = null,
                VisibleDockables = CreateList <DM.IDockable>
                                   (
                    new DMC.ToolDock
                {
                    Id               = nameof(DMC.IToolDock),
                    Title            = "EditorLeftTop",
                    Proportion       = double.NaN,
                    ActiveDockable   = projectTool,
                    VisibleDockables = CreateList <DM.IDockable>
                                       (
                        projectTool,
                        optionsTool,
                        rendererTool,
                        imagesTool
                                       )
                },
                    new DMC.SplitterDock()
                {
                    Id    = nameof(DMC.ISplitterDock),
                    Title = "LeftTopSplitter"
                },
                    new DMC.ToolDock
                {
                    Id               = nameof(DMC.IToolDock),
                    Title            = "EditorLeftBottom",
                    Proportion       = double.NaN,
                    ActiveDockable   = groupsTool,
                    VisibleDockables = CreateList <DM.IDockable>
                                       (
                        groupsTool,
                        databasesTool,
                        toolsTool,
                        scriptsTool
                                       )
                }
                                   )
            };

            var rightPane = new DMC.ProportionalDock
            {
                Id               = nameof(DMC.IProportionalDock),
                Title            = "EditorRight",
                Orientation      = DM.Orientation.Vertical,
                Proportion       = 0.20,
                ActiveDockable   = null,
                VisibleDockables = CreateList <DM.IDockable>
                                   (
                    new DMC.ToolDock
                {
                    Id               = nameof(DMC.IToolDock),
                    Title            = "EditorRightTop",
                    Proportion       = double.NaN,
                    ActiveDockable   = stylesTool,
                    VisibleDockables = CreateList <DM.IDockable>
                                       (
                        stylesTool,
                        containerTool,
                        templatesTool,
                        templateTool
                                       )
                },
                    new DMC.SplitterDock()
                {
                    Id    = nameof(DMC.ISplitterDock),
                    Title = "RightTopSplitter"
                },
                    new DMC.ToolDock
                {
                    Id               = nameof(DMC.IToolDock),
                    Title            = "EditorRightBottom",
                    Proportion       = double.NaN,
                    ActiveDockable   = shapeTool,
                    VisibleDockables = CreateList <DM.IDockable>
                                       (
                        shapeTool,
                        propertiesTool,
                        recordTool,
                        styleTool,
                        zoomTool
                                       )
                }
                                   )
            };

            var documentsPane = new DMC.DocumentDock
            {
                Id               = nameof(DMC.IDocumentDock),
                Title            = "DocumentsPane",
                IsCollapsable    = false,
                Proportion       = double.NaN,
                ActiveDockable   = pageDocument,
                VisibleDockables = CreateList <DM.IDockable>
                                   (
                    pageDocument,
                    documentTool,
                    scriptTool,
                    exportTool,
                    browserTool
                                   )
            };

            // Editor

            var editorLayout = new DMC.ProportionalDock
            {
                Id               = nameof(DMC.IProportionalDock),
                Title            = "EditorLayout",
                Orientation      = DM.Orientation.Horizontal,
                Proportion       = double.NaN,
                ActiveDockable   = null,
                VisibleDockables = CreateList <DM.IDockable>
                                   (
                    leftPane,
                    new DMC.SplitterDock()
                {
                    Id    = nameof(DMC.ISplitterDock),
                    Title = "LeftSplitter"
                },
                    documentsPane,
                    new DMC.SplitterDock()
                {
                    Id    = nameof(DMC.ISplitterDock),
                    Title = "RightSplitter"
                },
                    rightPane
                                   )
            };

            // Views

            var dashboardView = new DashboardView
            {
                Id    = nameof(DashboardView),
                Title = "Dashboard"
            };

            var editorView = new EditorView
            {
                Id               = nameof(EditorView),
                Title            = "Editor",
                ActiveDockable   = editorLayout,
                VisibleDockables = CreateList <DM.IDockable>
                                   (
                    editorLayout
                                   )
            };

            // Root

            var root = new DMC.RootDock
            {
                Id               = nameof(DMC.IRootDock),
                Title            = "Root",
                IsCollapsable    = false,
                ActiveDockable   = dashboardView,
                DefaultDockable  = dashboardView,
                VisibleDockables = CreateList <DM.IDockable>
                                   (
                    dashboardView,
                    editorView
                                   )
            };

            root.Top              = CreatePinDock();
            root.Top.Alignment    = DM.Alignment.Top;
            root.Bottom           = CreatePinDock();
            root.Bottom.Alignment = DM.Alignment.Bottom;
            root.Left             = CreatePinDock();
            root.Left.Alignment   = DM.Alignment.Left;
            root.Right            = CreatePinDock();
            root.Right.Alignment  = DM.Alignment.Right;

            return(root);
        }