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


C# ObjectCreator.add方法代码示例

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


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

示例1: getEdits

            public string getEdits(string profile)
            {
                SimSet set = new ObjectCreator("SimSet").Create();

                for (uint i = 0; i < this.getCount(); i++)
                    {
                    SimObject obj = this.getObject(i);
                    if (obj["profile"] == profile)
                        set.add(obj);
                    }
                return set;
            }
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:12,代码来源:GuiEditorProfiles.ed.cs

示例2: buildStaticFilters


//.........这里部分代码省略.........
            oc_Newobject53["VertSizing"] = "bottom";
            oc_Newobject53["isContainer"] = "1";

            #endregion

            oc_Newobject57["#Newobject53"] = oc_Newobject53;

            #region GuiTextCtrl ()        oc_Newobject54

            ObjectCreator oc_Newobject54 = new ObjectCreator("GuiTextCtrl", "");
            oc_Newobject54["Profile"] = "EditorTextProfile";
            oc_Newobject54["position"] = "5 0";
            oc_Newobject54["Extent"] = "118 18";
            oc_Newobject54["text"] = "Tags";

            #endregion

            oc_Newobject57["#Newobject54"] = oc_Newobject54;

            #region GuiBitmapButtonCtrl ()        oc_Newobject55

            ObjectCreator oc_Newobject55 = new ObjectCreator("GuiBitmapButtonCtrl", "");
            oc_Newobject55["canSaveDynamicFields"] = "0";
            oc_Newobject55["Enabled"] = "1";
            oc_Newobject55["isContainer"] = "0";
            oc_Newobject55["Profile"] = "ToolsGuiDefaultProfile";
            oc_Newobject55["HorizSizing"] = "left";
            oc_Newobject55["VertSizing"] = "bottom";
            oc_Newobject55["position"] = "105 2";
            oc_Newobject55["Extent"] = "15 15";
            oc_Newobject55["MinExtent"] = "8 2";
            oc_Newobject55["canSave"] = "1";
            oc_Newobject55["Visible"] = "1";
            oc_Newobject55["Command"] = "MaterialSelector_addFilterWindow.setVisible(1); MaterialSelectorOverlay.pushToBack(MaterialSelector_addFilterWindow);";
            oc_Newobject55["hovertime"] = "1000";
            oc_Newobject55["tooltip"] = "Create New Tag";
            oc_Newobject55["bitmap"] = "tools/gui/images/new";
            oc_Newobject55["groupNum"] = "-1";
            oc_Newobject55["buttonType"] = "PushButton";
            oc_Newobject55["useMouseEvents"] = "0";

            #endregion

            oc_Newobject57["#Newobject55"] = oc_Newobject55;

            #region GuiBitmapButtonCtrl ()        oc_Newobject56

            ObjectCreator oc_Newobject56 = new ObjectCreator("GuiBitmapButtonCtrl", "");
            oc_Newobject56["canSaveDynamicFields"] = "0";
            oc_Newobject56["Enabled"] = "1";
            oc_Newobject56["isContainer"] = "0";
            oc_Newobject56["Profile"] = "ToolsGuiDefaultProfile";
            oc_Newobject56["HorizSizing"] = "left";
            oc_Newobject56["VertSizing"] = "bottom";
            oc_Newobject56["position"] = "89 2";
            oc_Newobject56["Extent"] = "13 13";
            oc_Newobject56["MinExtent"] = "8 2";
            oc_Newobject56["canSave"] = "1";
            oc_Newobject56["Visible"] = "1";
            oc_Newobject56["Command"] = "MaterialSelector.clearMaterialFilters();";
            oc_Newobject56["hovertime"] = "1000";
            oc_Newobject56["tooltip"] = "Clear Selected Tag";
            oc_Newobject56["bitmap"] = "tools/gui/images/clear-btn";
            oc_Newobject56["groupNum"] = "-1";
            oc_Newobject56["buttonType"] = "PushButton";
            oc_Newobject56["useMouseEvents"] = "0";
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:67,代码来源:MaterialSelector.ed.cs

示例3: loadFilter

        public void loadFilter(string selectedFilter, string staticFilter = "")
        {
            ArrayObject MatEdScheduleArray = "MatEdScheduleArray";
            ArrayObject MatEdPreviewArray = "MatEdPreviewArray";

            GuiDynamicCtrlArrayControl materialSelection = this.FOT("materialSelection");
            GuiStackControl materialPreviewPagesStack = this.FOT("materialPreviewPagesStack");
            GuiPopUpMenuCtrlEx materialPreviewCountPopup = this.FOT("materialPreviewCountPopup");

            // manage schedule array properly
            if (!MatEdScheduleArray.isObject())
                MatEdScheduleArray = new ObjectCreator("ArrayObject", "MatEdScheduleArray").Create();

            // if we select another list... delete all schedules that were created by 
            // previous load
            for (int i = 0; i < MatEdScheduleArray.count(); i++)
                Util.cancel(MatEdScheduleArray.getKey(i).AsInt());

            // we have to empty out the list; so when we create new schedules, these dont linger
            MatEdScheduleArray.empty();

            // manage preview array
            if (!MatEdPreviewArray.isObject())
                MatEdPreviewArray = new ObjectCreator("ArrayObject", "MatEdPreviewArray").Create();

            // we have to empty out the list; so when we create new guicontrols, these dont linger
            MatEdPreviewArray.empty();
            materialSelection.deleteAllObjects();
            materialPreviewPagesStack.deleteAllObjects();

            // changed to accomadate tagging. dig through the array for each tag name,
            // call unique value, sort, and we have a perfect set of materials
            if (staticFilter != "")
                this.currentStaticFilter = staticFilter;

            this.currentFilter = selectedFilter;

            ArrayObject filteredObjectsArray = new ObjectCreator("ArrayObject").Create();

            int previewsPerPage = materialPreviewCountPopup.getTextById(materialPreviewCountPopup.getSelected()).AsInt();

            int tagCount = Util.getWordCount(this.currentFilter);
            if (tagCount != 0)
                {
                for (int j = 0; j < tagCount; j++)
                    {
                    for (int i = 0; i < this.currentStaticFilter.count(); i++)
                        {
                        string currentTag = Util.getWord(this.currentFilter, j);
                        if (this.currentStaticFilter.getKey(i) == currentTag)
                            filteredObjectsArray.add(this.currentStaticFilter.getKey(i), this.currentStaticFilter.getValue(i));
                        }
                    }

                filteredObjectsArray.uniqueValue();
                filteredObjectsArray.sortd();

                this.totalPages = Util.mCeil(filteredObjectsArray.count()/previewsPerPage);

                //Can we maintain the current preview page, or should we go to page 1?
                if ((this.currentPreviewPage*previewsPerPage) >= filteredObjectsArray.count())
                    this.currentPreviewPage = 0;

                // Build out the pages buttons
                this.buildPagesButtons(this.currentPreviewPage, this.totalPages);

                int previewCount = previewsPerPage;
                int possiblePreviewCount = filteredObjectsArray.count() - this.currentPreviewPage*previewsPerPage;
                if (possiblePreviewCount < previewCount)
                    previewCount = possiblePreviewCount;

                int start = this.currentPreviewPage*previewsPerPage;
                for (int i = start; i < start + previewCount; i++)
                    this.buildPreviewArray(filteredObjectsArray.getValue(i));

                filteredObjectsArray.delete();
                }
            else
                {
                this.currentStaticFilter.sortd();

                // Rebuild the static filter list without tagged materials
                ArrayObject noTagArray = new ObjectCreator("ArrayObject").Create();
                for (int i = 0; i < this.currentStaticFilter.count(); i++)
                    {
                    if (this.currentStaticFilter.getKey(i) != "")
                        continue;

                    SimObject material = this.currentStaticFilter.getValue(i);

                    // CustomMaterials are not available for selection
                    if (!material.isObject() || material.isMemberOfClass("CustomMaterial"))
                        continue;

                    noTagArray.add("", material);
                    }

                this.totalPages = Util.mCeil(noTagArray.count()/previewsPerPage);

                //Can we maintain the current preview page, or should we go to page 1?
//.........这里部分代码省略.........
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:101,代码来源:MaterialSelector.ed.cs

示例4: onControlInspectPostApply

            public override void onControlInspectPostApply(GuiControl control)
            {
                GuiEditorTreeView GuiEditorTreeView = "GuiEditorTreeView";

                SimSet set = new ObjectCreator("SimSet").Create();
                set.add(control);
                this.onPostEdit(set);
                set.delete();
                GuiEditorTreeView.update();
            }
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:10,代码来源:GuiEditorGui.ed.cs

示例5: initialize

        public static void initialize()
        {
            #region GuiControl (MaterialSelectorOverlay, EditorGuiGroup)        oc_Newobject42

            ObjectCreator oc_Newobject42 = new ObjectCreator("GuiControl", "MaterialSelectorOverlay, EditorGuiGroup");
            oc_Newobject42["canSaveDynamicFields"] = "0";
            oc_Newobject42["Profile"] = "GuiOverlayProfile";
            oc_Newobject42["Enabled"] = "1";
            oc_Newobject42["isContainer"] = "1";
            oc_Newobject42["HorizSizing"] = "right";
            oc_Newobject42["VertSizing"] = "bottom";
            oc_Newobject42["Position"] = "0 0";
            oc_Newobject42["Extent"] = "1024 768";
            oc_Newobject42["MinExtent"] = "8 2";
            oc_Newobject42["canSave"] = "1";
            oc_Newobject42["Visible"] = "1";
            oc_Newobject42["hovertime"] = "1000";

            #region GuiWindowCtrl (MaterialSelector)        oc_Newobject36

            ObjectCreator oc_Newobject36 = new ObjectCreator("GuiWindowCtrl", "MaterialSelector", typeof (MaterialSelector));
            oc_Newobject36["profile"] = "ToolsGuiWindowProfile";
            oc_Newobject36["HorizSizing"] = "center";
            oc_Newobject36["VertSizing"] = "center";
            oc_Newobject36["resizeWidth"] = "1";
            oc_Newobject36["resizeHeight"] = "1";
            oc_Newobject36["canClose"] = "1";
            oc_Newobject36["canMinimize"] = "0";
            oc_Newobject36["canMaximize"] = "0";
            oc_Newobject36["position"] = "72 98";
            oc_Newobject36["extent"] = " 766 550";
            oc_Newobject36["MinExtent"] = "383 274";
            oc_Newobject36["text"] = "Material Selector";
            oc_Newobject36["closeCommand"] = "MaterialSelector.hideDialog();";
            oc_Newobject36["EdgeSnap"] = "0";
            oc_Newobject36["canCollapse"] = "0";
            oc_Newobject36["visible"] = "0";

            #region GuiContainer ()        oc_Newobject1

            ObjectCreator oc_Newobject1 = new ObjectCreator("GuiContainer", "");
            oc_Newobject1["isContainer"] = "1";
            oc_Newobject1["HorizSizing"] = "right";
            oc_Newobject1["VertSizing"] = "bottom";
            oc_Newobject1["Position"] = "4 22";
            oc_Newobject1["Extent"] = "120 31";
            oc_Newobject1["Profile"] = "inspectorStyleRolloutDarkProfile";

            #endregion

            oc_Newobject36["#Newobject1"] = oc_Newobject1;

            #region GuiTextCtrl ()        oc_Newobject2

            ObjectCreator oc_Newobject2 = new ObjectCreator("GuiTextCtrl", "");
            oc_Newobject2["Profile"] = "ToolsGuiDefaultProfile";
            oc_Newobject2["HorizSizing"] = "right";
            oc_Newobject2["VertSizing"] = "bottom";
            oc_Newobject2["position"] = "10 23";
            oc_Newobject2["extent"] = "30 16";
            oc_Newobject2["text"] = "Filters";

            #endregion

            oc_Newobject36["#Newobject2"] = oc_Newobject2;

            #region GuiContainer ()        oc_Newobject5

            ObjectCreator oc_Newobject5 = new ObjectCreator("GuiContainer", "");
            oc_Newobject5["profile"] = "ToolsGuiDefaultProfile";
            oc_Newobject5["Position"] = "4 39";
            oc_Newobject5["Extent"] = "120 507";
            oc_Newobject5["HorizSizing"] = "right";
            oc_Newobject5["VertSizing"] = "height";
            oc_Newobject5["isContainer"] = "1";

            #region GuiScrollCtrl ()        oc_Newobject4

            ObjectCreator oc_Newobject4 = new ObjectCreator("GuiScrollCtrl", "");
            oc_Newobject4["canSaveDynamicFields"] = "0";
            oc_Newobject4["Enabled"] = "1";
            oc_Newobject4["isContainer"] = "1";
            oc_Newobject4["Profile"] = "GuiEditorScrollProfile";
            oc_Newobject4["HorizSizing"] = "width";
            oc_Newobject4["VertSizing"] = "height";
            oc_Newobject4["Position"] = "0 0";
            oc_Newobject4["Extent"] = "128 355";
            oc_Newobject4["MinExtent"] = "8 8";
            oc_Newobject4["canSave"] = "1";
            oc_Newobject4["isDecoy"] = "0";
            oc_Newobject4["Visible"] = "1";
            oc_Newobject4["tooltipprofile"] = "ToolsGuiDefaultProfile";
            oc_Newobject4["hovertime"] = "1000";
            oc_Newobject4["Docking"] = "Client";
            oc_Newobject4["Margin"] = "0 0 0 0";
            oc_Newobject4["Padding"] = "0 0 0 0";
            oc_Newobject4["AnchorTop"] = "1";
            oc_Newobject4["AnchorBottom"] = "0";
            oc_Newobject4["AnchorLeft"] = "1";
            oc_Newobject4["AnchorRight"] = "0";
//.........这里部分代码省略.........
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:101,代码来源:MaterialSelector.ed.cs

示例6: onControlInspectPreApply

 public override void onControlInspectPreApply(GuiControl control)
 {
     SimSet set = new ObjectCreator("SimSet").Create();
     set.add(control);
     this.onPreEdit(set);
     this.pendingGenericUndoAction.actionName = "Change Properties";
     set.delete();
 }
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:8,代码来源:GuiEditorGui.ed.cs

示例7: onAddNewCtrl

            public override void onAddNewCtrl(GuiControl ctrl)
            {
                GuiEditorUndo.UndoActionAddObject UndoActionAddObject = "UndoActionAddObject";
                GuiEditorTreeView GuiEditorTreeView = "GuiEditorTreeView";

                SimSet set = new ObjectCreator("SimSet").Create();
                set.add(ctrl);
                GuiEditorUndo.UndoActionAddObject act = UndoActionAddObject.create(set, this.getTrash(), GuiEditorTreeView, false);
                set.delete();
                act.addToManager(this.getUndoManager());
                this.updateUndoMenu();
                //GuiEditorInspectFields.update(0);
            }
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:13,代码来源:GuiEditorGui.ed.cs

示例8: deleteControl

            public void deleteControl(SimObject ctrl)
            {
                GuiEditorUndo.UndoActionDeleteObject UndoActionDeleteObject = "UndoActionDeleteObject";
                GuiEditorTreeView GuiEditorTreeView = "GuiEditorTreeView";

                // Unselect.

                this.removeSelection(ctrl);

                // Record undo.

                SimSet set = new ObjectCreator("SimSet").Create();
                set.parentGroup = "RootGroup";

                set.add(ctrl);

                GuiEditorUndo.UndoActionDeleteObject action = UndoActionDeleteObject.create(set, this.getTrash(), GuiEditorTreeView, true);
                action.addToManager(this.getUndoManager());
                this.updateUndoMenu();

                GuiEditorTreeView.update();
                set.delete();

                // Remove.

                ((SimSet) this.getTrash()).add(ctrl);
            }
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:27,代码来源:GuiEditorGui.ed.cs

示例9: loadLights

        public void loadLights()
        {
            SimGroup MissionGroup = "MissionGroup";
            EditorTree EditorTree = "EditorTree";

            // Get the ID of the last object added
            SimObject obj = MissionGroup.getObject((uint) MissionGroup.getCount() - 1);

            // Create a new SimGroup to hold the model and lights
            SimGroup group = new ObjectCreator("SimGroup").Create();
            Util.loadColladaLights(this.path, group, obj);

            // Delete the SimGroup if no lights were found. Otherwise, add the model to
            // the group as well.
            if (group.getCount() > 0)
                {
                group.add(obj);
                group.bringToFront(obj);
                MissionGroup.add(group);
                if (EditorTree.isVisible())
                    {
                    EditorTree.removeItem(EditorTree.findItemByObjectId(obj));
                    EditorTree.buildVisibleTree(true);
                    }
                }
            else
                group.delete();
        }
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:28,代码来源:ColladaImportDlg.ed.cs

示例10: 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.add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。