当前位置: 首页>>代码示例>>C#>>正文


C# ObjectCreator.bindCmd方法代码示例

本文整理汇总了C#中WinterLeaf.Engine.Classes.View.Creators.ObjectCreator.bindCmd方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectCreator.bindCmd方法的具体用法?C# ObjectCreator.bindCmd怎么用?C# ObjectCreator.bindCmd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WinterLeaf.Engine.Classes.View.Creators.ObjectCreator的用法示例。


在下文中一共展示了ObjectCreator.bindCmd方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: initialize

        public void initialize()
        {
            ObjectCreator oc_Newobject3 = new ObjectCreator("SimSet", "ForestTools");

            ObjectCreator oc_Newobject2 = new ObjectCreator("ForestBrushTool");
            oc_Newobject2["internalName"] = "BrushTool";
            oc_Newobject2["toolTip"] = "Paint Tool";
            oc_Newobject2["buttonImage"] = "tools/forest/images/brushTool";

            oc_Newobject3["#Newobject2"] = oc_Newobject2;

            ObjectCreator oc_Newobject1 = new ObjectCreator("ForestSelectionTool");
            oc_Newobject1["internalName"] = "SelectionTool";
            oc_Newobject1["toolTip"] = "Selection Tool";
            oc_Newobject1["buttonImage"] = "tools/forest/images/selectionTool";
            oc_Newobject3["#Newobject1"] = oc_Newobject1;

            oc_Newobject3.Create();

            ActionMap map = new ObjectCreator("ActionMap").Create();
            map.bindCmd("keyboard", "1", "ForestEditorSelectModeBtn.performClick();", ""); // Select
            map.bindCmd("keyboard", "2", "ForestEditorMoveModeBtn.performClick();", ""); // Move
            map.bindCmd("keyboard", "3", "ForestEditorRotateModeBtn.performClick();", ""); // Rotate
            map.bindCmd("keyboard", "4", "ForestEditorScaleModeBtn.performClick();", ""); // Scale
            map.bindCmd("keyboard", "5", "ForestEditorPaintModeBtn.performClick();", ""); // Paint
            map.bindCmd("keyboard", "6", "ForestEditorEraseModeBtn.performClick();", ""); // Erase
            map.bindCmd("keyboard", "7", "ForestEditorEraseSelectedModeBtn.performClick();", ""); // EraseSelected   
            map.bindCmd("keyboard", "8", "ForestEditorDropToGroundModeBtn.performClick();", ""); // DropTheBeat
            //%map.bindCmd( keyboard, "backspace", "ForestEditorGui.onDeleteKey();", "" );
            //%map.bindCmd( keyboard, "delete", "ForestEditorGui.onDeleteKey();", "" );   
            this.map = map;
        }
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:32,代码来源:ForestEditorPlugin.cs

示例2: initialize

        public void initialize()
        {
            ActionMap map = new ObjectCreator("ActionMap").Create();
            map.bindCmd("keyboard", "1", "EWorldEditorNoneModeBtn.performClick();", ""); // Select
            map.bindCmd("keyboard", "2", "EWorldEditorMoveModeBtn.performClick();", ""); // Move
            map.bindCmd("keyboard", "3", "EWorldEditorRotateModeBtn.performClick();", ""); // Rotate
            map.bindCmd("keyboard", "4", "EWorldEditorScaleModeBtn.performClick();", ""); // Scale

            this.map = map;

            new ObjectCreator("ScriptObject", "ParticleEditor", typeof (ParticleEditor)).Create();

            new ObjectCreator("PersistenceManager", "PE_EmitterSaver").Create();
            new ObjectCreator("PersistenceManager", "PE_ParticleSaver").Create();

            new ObjectCreator("SimSet", "PE_UnlistedParticles").Create();
            new ObjectCreator("SimSet", "PE_UnlistedEmitters").Create();
        }
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:18,代码来源:ParticleEditorPlugin.cs

示例3: onWorldEditorStartup

        public override void onWorldEditorStartup()
        {
            EditorGui EditorGui = "EditorGui";
            base.onWorldEditorStartup();
            // Add ourselves to the window menu.
            string accel = EditorGui.addToEditorsMenu("Terrain Editor", "", this);
            // Add ourselves to the ToolsToolbar
            string tooltip = "Terrain Editor (" + accel + ")";
            EditorGui.addToToolsToolbar("TerrainEditorPlugin", "TerrainEditorPalette", Util._expandFilename("tools/worldEditor/images/toolbar/sculpt-terrain"), tooltip);

            ActionMap map = new ObjectCreator("ActionMap").Create();
            map.bindCmd("keyboard", "1", "ToolsPaletteArray->brushAdjustHeight.performClick();", ""); //Grab Terrain
            map.bindCmd("keyboard", "2", "ToolsPaletteArray->raiseHeight.performClick();", ""); // Raise Height
            map.bindCmd("keyboard", "3", "ToolsPaletteArray->lowerHeight.performClick();", ""); // Lower Height
            map.bindCmd("keyboard", "4", "ToolsPaletteArray->smoothHeight.performClick();", ""); // Average Height
            map.bindCmd("keyboard", "5", "ToolsPaletteArray->smoothSlope.performClick();", ""); // Smooth Slope
            map.bindCmd("keyboard", "6", "ToolsPaletteArray->paintNoise.performClick();", ""); // Noise
            map.bindCmd("keyboard", "7", "ToolsPaletteArray->flattenHeight.performClick();", ""); // Flatten
            map.bindCmd("keyboard", "8", "ToolsPaletteArray->setHeight.performClick();", ""); // Set Height
            map.bindCmd("keyboard", "9", "ToolsPaletteArray->setEmpty.performClick();", ""); // Clear Terrain
            map.bindCmd("keyboard", "0", "ToolsPaletteArray->clearEmpty.performClick();", ""); // Restore Terrain
            map.bindCmd("keyboard", "v", "EWTerrainEditToolbarBrushType->ellipse.performClick();", ""); // Circle Brush
            map.bindCmd("keyboard", "b", "EWTerrainEditToolbarBrushType->box.performClick();", ""); // Box Brush
            map.bindCmd("keyboard", "=", "TerrainEditorPlugin.keyboardModifyBrushSize(1);", ""); // +1 Brush Size
            map.bindCmd("keyboard", "+", "TerrainEditorPlugin.keyboardModifyBrushSize(1);", ""); // +1 Brush Size
            map.bindCmd("keyboard", "-", "TerrainEditorPlugin.keyboardModifyBrushSize(-1);", ""); // -1 Brush Size
            map.bindCmd("keyboard", "[", "TerrainEditorPlugin.keyboardModifyBrushSize(-5);", ""); // -5 Brush Size
            map.bindCmd("keyboard", "]", "TerrainEditorPlugin.keyboardModifyBrushSize(5);", ""); // +5 Brush Size

            this["map"] = map;

            ObjectCreator oc = new ObjectCreator("PopupMenu", "", typeof (MenuBuilder));
            //oc["superClass"] = "MenuBuilder";

            oc["barTitle"] = "Terrain";

            oc["item[0]"] = "Smooth Heightmap" + "\t" + "" + "\t" + "ETerrainEditor.onSmoothHeightmap();";
            oc["item[1]"] = "Solder Edges" + "\t" + "" + "\t" + "ETerrainEditor.onSolderEdges();";

            this["terrainMenu"] = oc.Create().AsString();
        }
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:41,代码来源:TerrainEditorPlugin.cs

示例4: onWorldEditorStartup

        public override void onWorldEditorStartup()
        {
            EditorGui EditorGui = "EditorGui";
            base.onWorldEditorStartup();
            // Add ourselves to the window menu.

            string accel = EditorGui.addToEditorsMenu("Terrain Painter", "", this);
            // Add ourselves to the ToolsToolbar
            string tooltip = "Terrain Painter (" + accel + ")";

            EditorGui.addToToolsToolbar("TerrainPainterPlugin", "TerrainPainterPalette", Util._expandFilename("tools/worldEditor/images/toolbar/paint-terrain"), tooltip);
            ActionMap map = new ObjectCreator("ActionMap").Create();

            string keyboard = "keyboard";

            map.bindCmd(keyboard, "v", "EWTerrainPainterToolbarBrushType->ellipse.performClick();", ""); // Circle Brush
            map.bindCmd(keyboard, "b", "EWTerrainPainterToolbarBrushType->box.performClick();", ""); // Box Brush
            map.bindCmd(keyboard, "=", "TerrainPainterPlugin.keyboardModifyBrushSize(1);", ""); // +1 Brush Size
            map.bindCmd(keyboard, "+", "TerrainPainterPlugin.keyboardModifyBrushSize(1);", ""); // +1 Brush Size
            map.bindCmd(keyboard, "-", "TerrainPainterPlugin.keyboardModifyBrushSize(-1);", ""); // -1 Brush Size
            map.bindCmd(keyboard, "[", "TerrainPainterPlugin.keyboardModifyBrushSize(-5);", ""); // -5 Brush Size
            map.bindCmd(keyboard, "]", "TerrainPainterPlugin.keyboardModifyBrushSize(5);", ""); // +5 Brush Size

            for (int i = 0; i < 10; i++)
                map.bindCmd(keyboard, i.AsString(), "TerrainPainterPlugin.keyboardSetMaterial(" + (i - 1) + ");", "");

            map.bindCmd(keyboard, "0", "TerrainPainterPlugin.keyboardSetMaterial(10);", "");

            this.map = map;

            //console.Call_Classname("GuiWindowCtrl", "attach", new[] { "TerrainPainter", "TerrainPainterPreview" });
            TerrainPainter TerrainPainter = "TerrainPainter";
            TerrainPainter.attachTo("TerrainPainterPreview");
        }
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:34,代码来源:TerainPainterPlugin.cs

示例5: initialize

        public void initialize()
        {
            ActionMap map = new ObjectCreator("ActionMap").Create();
            map.bindCmd("keyboard", "backspace", "RiverEditorGui.deleteNode();", "");
            map.bindCmd("keyboard", "1", "RiverEditorGui.prepSelectionMode();", "");
            map.bindCmd("keyboard", "2", "ToolsPaletteArray->RiverEditorMoveMode.performClick();", "");
            map.bindCmd("keyboard", "3", "ToolsPaletteArray->RiverEditorRotateMode.performClick();", "");
            map.bindCmd("keyboard", "4", "ToolsPaletteArray->RiverEditorScaleMode.performClick();", "");
            map.bindCmd("keyboard", "5", "ToolsPaletteArray->RiverEditorAddRiverMode.performClick();", "");
            map.bindCmd("keyboard", "=", "ToolsPaletteArray->RiverEditorInsertPointMode.performClick();", "");
            map.bindCmd("keyboard", "numpadadd", "ToolsPaletteArray->RiverEditorInsertPointMode.performClick();", "");
            map.bindCmd("keyboard", "-", "ToolsPaletteArray->RiverEditorRemovePointMode.performClick();", "");
            map.bindCmd("keyboard", "numpadminus", "ToolsPaletteArray->RiverEditorRemovePointMode.performClick();", "");
            map.bindCmd("keyboard", "z", "RiverEditorShowSplineBtn.performClick();", "");
            map.bindCmd("keyboard", "x", "RiverEditorWireframeBtn.performClick();", "");
            map.bindCmd("keyboard", "v", "RiverEditorShowRoadBtn.performClick();", "");
            this.map = map;

            this.initSettings();
        }
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:20,代码来源:RiverEditorPlugin.cs

示例6: initialize

        public void initialize()
        {
            ActionMap map = new ObjectCreator("ActionMap").Create();
            map.bindCmd("keyboard", "escape", "ToolsToolbarArray->WorldEditorInspectorPalette.performClick();", "");
            map.bindCmd("keyboard", "1", "ShapeEditorNoneModeBtn.performClick();", "");
            map.bindCmd("keyboard", "2", "ShapeEditorMoveModeBtn.performClick();", "");
            map.bindCmd("keyboard", "3", "ShapeEditorRotateModeBtn.performClick();", "");
            //%map.bindCmd( keyboard, "4", "ShapeEditorScaleModeBtn.performClick();", "" ); // not needed for the shape editor
            map.bindCmd("keyboard", "n", "ShapeEditorToolbar->showNodes.performClick();", "");
            map.bindCmd("keyboard", "t", "ShapeEditorToolbar->ghostMode.performClick();", "");
            map.bindCmd("keyboard", "r", "ShapeEditorToolbar->wireframeMode.performClick();", "");
            map.bindCmd("keyboard", "f", "ShapeEditorToolbar->fitToShapeBtn.performClick();", "");
            map.bindCmd("keyboard", "g", "ShapeEditorToolbar->showGridBtn.performClick();", "");
            map.bindCmd("keyboard", "h", "ShapeEdSelectWindow->tabBook.selectPage( 2 );", ""); // Load help tab
            map.bindCmd("keyboard", "l", "ShapeEdSelectWindow->tabBook.selectPage( 1 );", ""); // load Library Tab
            map.bindCmd("keyboard", "j", "ShapeEdSelectWindow->tabBook.selectPage( 0 );", ""); // load scene object Tab
            map.bindCmd("keyboard", "SPACE", "ShapeEdAnimWindow.togglePause();", "");
            map.bindCmd("keyboard", "i", "ShapeEdSequences.onEditSeqInOut(\"in\", ShapeEdSeqSlider.getValue());", "");
            map.bindCmd("keyboard", "o", "ShapeEdSequences.onEditSeqInOut(\"out\", ShapeEdSeqSlider.getValue());", "");
            map.bindCmd("keyboard", "shift -", "ShapeEdSeqSlider.setValue(ShapeEdAnimWindow-->seqIn.getText());", "");
            map.bindCmd("keyboard", "shift =", "ShapeEdSeqSlider.setValue(ShapeEdAnimWindow-->seqOut.getText());", "");
            map.bindCmd("keyboard", "=", "ShapeEdAnimWindow-->stepFwdBtn.performClick();", "");
            map.bindCmd("keyboard", "-", "ShapeEdAnimWindow-->stepBkwdBtn.performClick();", "");

            this.map = map;

            this.initSettings();
        }
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:28,代码来源:ShapeEditorPlugin.cs

示例7: initialize

        public static void initialize()
        {
            if ("moveMap".isObject())
                "moveMap".delete();

            ActionMap moveMap = new ObjectCreator("ActionMap", "moveMap").Create();
            ActionMap GlobalActionMap = "GlobalActionMap";

            moveMap.bindCmd("keyboard", "escape", "", "handleEscape();");
            moveMap.bind("keyboard", "F2", "showPlayerList");
            moveMap.bind("keyboard", "ctrl h", "hideHUDs");
            moveMap.bind("keyboard", "alt p", "doScreenShotHudless");

            moveMap.bind("keyboard", "a", "moveleft");
            moveMap.bind("keyboard", "d", "moveright");
            moveMap.bind("keyboard", "left", "moveleft");
            moveMap.bind("keyboard", "right", "moveright");

            moveMap.bind("keyboard", "w", "moveforward");
            moveMap.bind("keyboard", "s", "movebackward");
            moveMap.bind("keyboard", "up", "moveforward");
            moveMap.bind("keyboard", "down", "movebackward");

            moveMap.bind("keyboard", "e", "moveup");
            moveMap.bind("keyboard", "c", "movedown");

            moveMap.bind("keyboard", "space", "jump");
            moveMap.bind("mouse", "xaxis", "yaw");
            moveMap.bind("mouse", "yaxis", "pitch");

            moveMap.bind("gamepad", "thumbrx", "D", "-0.23 0.23", "gamepadYaw");
            moveMap.bind("gamepad", "thumbry", "D", "-0.23 0.23", "gamepadPitch");
            moveMap.bind("gamepad", "thumblx", "D", "-0.23 0.23", "gamePadMoveX");
            moveMap.bind("gamepad", "thumbly", "D", "-0.23 0.23", "gamePadMoveY");

            moveMap.bind("gamepad", "btn_a", "jump");
            moveMap.bindCmd("gamepad", "btn_back", "disconnect();", "");

            moveMap.bindCmd("gamepad", "dpadl", "toggleLightColorViz();", "");
            moveMap.bindCmd("gamepad", "dpadr", "metrics(fps);", "");
            //moveMap.bindCmd("gamepad", "dpadu", "toggleDepthViz();", "");
            GlobalActionMap.bind("gamepad", "dpadu", "toggleConsole");
            moveMap.bindCmd("gamepad", "dpadd", "toggleNormalsViz();", "");
            //moveMap.bindCmd("gamepad", "dpadr", "toggleLightSpecularViz();", "");

            moveMap.bind("keyboard", "lcontrol", "doCrouch");
            moveMap.bind("gamepad", "btn_b", "doCrouch");

            moveMap.bind("keyboard", "lshift", "doSprint");
            moveMap.bind("gamepad", "btn_lt", "doSprint"); //Analog_LT Click

            moveMap.bind("mouse", "button0", "mouseFire");

            moveMap.bind("gamepad", "triggerr", "gamepadFire");
            moveMap.bind("gamepad", "triggerl", "gamepadAltTrigger");

            if (omni.sGlobal["$Player::CurrentFOV"] == "")
                omni.iGlobal["$Player::CurrentFOV"] = omni.iGlobal["$pref::Player::DefaultFOV"]/2;

            moveMap.bind("keyboard", "f", "setZoomFOV"); // f for field of view
            moveMap.bind("keyboard", "z", "toggleZoom"); // z for zoom
            moveMap.bind("mouse", "button1", "mouseButtonZoom");
            moveMap.bind("gamepad", "btn_rt", "toggleZoom");

            moveMap.bind("keyboard", "v", "toggleFreeLook"); // v for vanity
            moveMap.bind("keyboard", "tab", "toggleFirstPerson");
            moveMap.bind("keyboard", "alt c", "toggleCamera");

            moveMap.bind("gamepad", "btn_start", "toggleCamera");
            moveMap.bind("gamepad", "btn_y", "toggleFirstPerson");
            moveMap.bindCmd("gamepad", "btn_x", "commandToServer('reloadWeapon');", ""); //Button_X

            // ----------------------------------------------------------------------------
            // Misc. Player stuff
            // ----------------------------------------------------------------------------

            // Gideon does not have these animations, so the player does not need access to
            // them.  Commenting instead of removing so as to retain an example for those
            // who will want to use a player model that has these animations and wishes to
            // use them.

            //moveMap.bindCmd(keyboard, "ctrl w", "commandToServer('playCel',\"wave\");", "");
            //moveMap.bindCmd(keyboard, "ctrl s", "commandToServer('playCel',\"salute\");", "");

            moveMap.bindCmd("keyboard", "ctrl k", "commandToServer('suicide');", "");

            //------------------------------------------------------------------------------
            // Item manipulation
            //------------------------------------------------------------------------------
            moveMap.bindCmd("keyboard", "1", "commandToServer('use',\"Ryder\");", "");
            moveMap.bindCmd("keyboard", "2", "commandToServer('use',\"Lurker\");", "");
            moveMap.bindCmd("keyboard", "3", "commandToServer('use',\"LurkerGrenadeLauncher\");", "");
            moveMap.bindCmd("keyboard", "4", "commandToServer('use',\"ProxMine\");", "");
            moveMap.bindCmd("keyboard", "5", "commandToServer('use',\"DeployableTurret\");", "");

            moveMap.bindCmd("keyboard", "r", "commandToServer('reloadWeapon');", "");

            moveMap.bind("keyboard", "0", "unmountWeapon");

            moveMap.bind("keyboard", "alt w", "throwWeapon");
//.........这里部分代码省略.........
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:101,代码来源:default.bind.cs

示例8: initializeNavEditor

        public static void initializeNavEditor()
        {
            omni.Util._echo(" % - Initializing Navigation Editor");

            omni.iGlobal["$Nav::WalkFlag"] = 1 << 0;
            omni.iGlobal["$Nav::SwimFlag"] = 1 << 1;
            omni.iGlobal["$Nav::JumpFlag"] = 1 << 2;
            omni.iGlobal["$Nav::LedgeFlag"] = 1 << 3;
            omni.iGlobal["$Nav::DropFlag"] = 1 << 4;
            omni.iGlobal["$Nav::ClimbFlag"] = 1 << 5;
            omni.iGlobal["$Nav::TeleportFlag"] = 1 << 6;

            // Execute all relevant scripts and GUIs.
            //exec("./NavEditor.cs");
            NavEditorProfiles.initialize();
            //exec("./NavEditorGui.gui");
            gui.NavEditorGui.initialize();
            //exec("./NavEditorToolbar.gui");
            gui.NavEditorToolbar.initialize();
            //exec("./NavEditorGui.cs");
            //exec("./NavEditorAboutDlg.gui");
            NavEditorAboutDlg.initialize();
            //exec("./NavEditorConsoleDlg.gui");
            gui.NavEditorConsoleDlg.initialize();
            //exec("./CreateNewNavMeshDlg.gui");
            CreateNewNavMeshDlg.initialize();

            // Add ourselves to EditorGui, where all the other tools reside
            NavEditorGui NavEditorGui = "NavEditorGui";
            GuiControl NavEditorToolbar = "NavEditorToolbar";
            GuiWindowCollapseCtrl NavEditorOptionsWindow = "NavEditorOptionsWindow";
            GuiWindowCollapseCtrl NavEditorTreeWindow = "NavEditorTreeWindow";
            GuiWindowCtrl NavEditorConsoleDlg = "NavEditorConsoleDlg";
            NavEditorGui.setVisible(false);
            NavEditorToolbar.setVisible(false);
            NavEditorOptionsWindow.setVisible(false);
            NavEditorTreeWindow.setVisible(false);
            NavEditorConsoleDlg.setVisible(false);

            EditorGui EditorGui = "EditorGui";
            EditorGui.add(NavEditorGui);
            EditorGui.add(NavEditorToolbar);
            EditorGui.add(NavEditorOptionsWindow);
            EditorGui.add(NavEditorTreeWindow);
            EditorGui.add(NavEditorConsoleDlg);

            ObjectCreator oc = new ObjectCreator("ScriptObject", "NavEditorPlugin", typeof (NavEditorPlugin));
            oc["editorGui"] = NavEditorGui;
            oc.Create();

            // Bind shortcuts for the nav editor.
            ActionMap map = new ObjectCreator("ActionMap").Create();
            map.bindCmd("keyboard", "1", "ENavEditorSelectModeBtn.performClick();", "");
            map.bindCmd("keyboard", "2", "ENavEditorLinkModeBtn.performClick();", "");
            map.bindCmd("keyboard", "3", "ENavEditorCoverModeBtn.performClick();", "");
            map.bindCmd("keyboard", "4", "ENavEditorTileModeBtn.performClick();", "");
            map.bindCmd("keyboard", "5", "ENavEditorTestModeBtn.performClick();", "");
            map.bindCmd("keyboard", "c", "NavEditorConsoleBtn.performClick();", "");
            NavEditorPlugin NavEditorPlugin = "NavEditorPlugin";
            NavEditorPlugin.map = map;

            NavEditorPlugin.initSettings();
        }
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:63,代码来源:main.cs

示例9: onWorldEditorStartup

        public override void onWorldEditorStartup()
        {
            EditorGui EditorGui = "EditorGui";
            GuiWindowCollapseCtrl MaterialEditorPropertiesWindow = "MaterialEditorPropertiesWindow";
            MaterialEditor.MaterialEditorGui MaterialEditorGui = "MaterialEditorGui";
            CubemapData matEdCubeMapPreviewMat = "matEdCubeMapPreviewMat";
            CubemapData WarnMatCubeMap = "WarnMatCubeMap";

            // Add ourselves to the window menu.
            string accel = EditorGui.addToEditorsMenu("Material Editor", "", this);

            // Add ourselves to the ToolsToolbar
            string tooltip = "Material Editor (" + accel + ")";
            EditorGui.addToToolsToolbar("MaterialEditorPlugin", "MaterialEditorPalette", Util._expandFilename("tools/worldEditor/images/toolbar/matterial-editor"), tooltip);

            //connect editor windows
            MaterialEditorPropertiesWindow.attachTo("MaterialEditorPreviewWindow");

            ActionMap map = new ObjectCreator("ActionMap").Create();
            map.bindCmd("keyboard", "1", "EWorldEditorNoneModeBtn.performClick();", ""); // Select
            map.bindCmd("keyboard", "2", "EWorldEditorMoveModeBtn.performClick();", ""); // Move
            map.bindCmd("keyboard", "3", "EWorldEditorRotateModeBtn.performClick();", ""); // Rotate
            map.bindCmd("keyboard", "4", "EWorldEditorScaleModeBtn.performClick();", ""); // Scale
            map.bindCmd("keyboard", "f", "FitToSelectionBtn.performClick();", ""); // Fit Camera to Selection
            map.bindCmd("keyboard", "z", "EditorGuiStatusBar.setCamera(\"Standard Camera\");", ""); // Free Camera
            map.bindCmd("keyboard", "n", "ToggleNodeBar->renderHandleBtn.performClick();", ""); // Render Node
            map.bindCmd("keyboard", "shift n", "ToggleNodeBar->renderTextBtn.performClick();", ""); // Render Node Text
            map.bindCmd("keyboard", "alt s", "MaterialEditorGui.save();", ""); // Save Material
            //%map.bindCmd( keyboard, "delete", "ToggleNodeBar->renderTextBtn.performClick();", "" );// delete Material
            map.bindCmd("keyboard", "g", "ESnapOptions-->GridSnapButton.performClick();", ""); // Grid Snappping
            map.bindCmd("keyboard", "t", "SnapToBar->objectSnapDownBtn.performClick();", ""); // Terrain Snapping
            map.bindCmd("keyboard", "b", "SnapToBar-->objectSnapBtn.performClick();", ""); // Soft Snappping
            map.bindCmd("keyboard", "v", "EWorldEditorToolbar->boundingBoxColBtn.performClick();", "");
            // Bounds Selection
            map.bindCmd("keyboard", "o", "objectCenterDropdown->objectBoxBtn.performClick(); objectCenterDropdown.toggle();", "");
            // Object Center
            map.bindCmd("keyboard", "p", "objectCenterDropdown->objectBoundsBtn.performClick(); objectCenterDropdown.toggle();", "");
            // Bounds Center
            map.bindCmd("keyboard", "k", "objectTransformDropdown->objectTransformBtn.performClick(); objectTransformDropdown.toggle();", "");
            // Object Transform
            map.bindCmd("keyboard", "l", "objectTransformDropdown->worldTransformBtn.performClick(); objectTransformDropdown.toggle();", "");
            // World Transform
            this.map = map;

            MaterialEditorGui["fileSpec"] = "Torque Material Files (materials.cs)|materials.cs|All Files (*.*)|*.*";
            MaterialEditorGui["textureFormats"] = "Image Files (*.png, *.jpg, *.dds, *.bmp, *.gif, *.jng. *.tga)|*.png;*.jpg;*.dds;*.bmp;*.gif;*.jng;*.tga|All Files (*.*)|*.*";
            MaterialEditorGui["modelFormats"] = "DTS Files (*.dts)|*.dts";
            MaterialEditorGui["lastTexturePath"] = "";
            MaterialEditorGui["lastTextureFile"] = "";
            MaterialEditorGui["lastModelPath"] = "";
            MaterialEditorGui["lastModelFile"] = "";
            MaterialEditorGui.currentMaterial = "";
            MaterialEditorGui["lastMaterial"] = "";
            MaterialEditorGui["currentCubemap"] = "";
            MaterialEditorGui.currentObject = "";

            MaterialEditorGui["livePreview"] = "1";
            MaterialEditorGui["currentLayer"] = "0";
            MaterialEditorGui.currentMode = "Material";
            MaterialEditorGui.currentMeshMode = "EditorShape";

            ArrayObject UnlistedCubemaps = new ObjectCreator("ArrayObject", "UnlistedCubemaps").Create();
            UnlistedCubemaps.add("unlistedCubemaps", matEdCubeMapPreviewMat);
            UnlistedCubemaps.add("unlistedCubemaps", WarnMatCubeMap);

            //MaterialEditor persistence manager
            new ObjectCreator("PersistenceManager", "matEd_PersistMan").Create();
        }
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:68,代码来源:MaterialEditorPlugin.cs


注:本文中的WinterLeaf.Engine.Classes.View.Creators.ObjectCreator.bindCmd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。