public ObiParticleSelectionEditorTool(ObiActorBlueprintEditor editor) : base(editor) { m_Icon = Resources.Load <Texture2D>("SelectIcon"); m_Name = "Particle selection/editing"; selectionBrush = new ObiScreenSpaceBrush(null, UpdateSelection, null); selectMode = new ObiSelectBrushMode(new ObiBlueprintSelected(editor)); selectionBrush.brushMode = selectMode; tethersTool = new ObiTethersTool(); InitializeGroupsList(); }
public ObiBlueprintRenderModeDistanceConstraints(ObiActorBlueprintEditor editor) : base(editor) { }
public ObiBlueprintRenderModeShapeMatchingConstraints(ObiActorBlueprintEditor editor) : base(editor) { }
public ObiBlueprintRadius(ObiActorBlueprintEditor editor) : base(editor, 0.0000001f) { brushModes.Add(new ObiFloatPaintBrushMode(this)); brushModes.Add(new ObiFloatAddBrushMode(this)); brushModes.Add(new ObiFloatSmoothBrushMode(this)); }
public ObiBlueprintLayer(ObiActorBlueprintEditor editor) : base(0, (1 << 24) - 1) { this.editor = editor; brushModes.Add(new ObiIntPaintBrushMode(this)); }
public void DoTethers(ObiActorBlueprintEditor editor) { EditorGUILayout.LabelField("Tethers", EditorStyles.boldLabel); var tethers = editor.blueprint.GetConstraintsByType(Oni.ConstraintType.Tether); int tetherCount = 0; if (tethers != null) { tetherCount = tethers.GetConstraintCount(); } if (tetherCount > 0) { EditorGUILayout.LabelField("" + tetherCount + " tether constraints.", EditorStyles.helpBox); } else { EditorGUILayout.LabelField("No tether constraints. Select at least one particle group in the dropdown, then click 'Generate Tethers'.", EditorStyles.helpBox); } Array.Resize(ref tetheredGroups, editor.blueprint.groups.Count); // display the GenericMenu when pressing a button if (GUILayout.Button("Tethered groups", EditorStyles.popup)) { // create the menu and add items to it GenericMenu menu = new GenericMenu(); // forward slashes nest menu items under submenus for (int i = 0; i < editor.blueprint.groups.Count; ++i) { menu.AddItem(new GUIContent(editor.blueprint.groups[i].name), tetheredGroups[i], OnTetherGroupSelected, i); } // display the menu menu.DropDown(tetherDropdownRect); } if (Event.current.type == EventType.Repaint) { tetherDropdownRect = GUILayoutUtility.GetLastRect(); } EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Generate tethers", GUILayout.MinHeight(32))) { // Select all particles in the tethered groups: for (int i = 0; i < editor.selectionStatus.Length; ++i) { editor.selectionStatus[i] = false; for (int j = 0; j < tetheredGroups.Length; ++j) { if (tetheredGroups[j] && editor.blueprint.groups[j].ContainsParticle(i)) { editor.selectionStatus[i] = true; break; } } } editor.blueprint.GenerateTethers(editor.selectionStatus); editor.Refresh(); } if (GUILayout.Button("Clear tethers", GUILayout.MinHeight(32))) { editor.blueprint.ClearTethers(); editor.Refresh(); } EditorGUILayout.EndHorizontal(); }
public ObiBlueprintSkinStiffness(ObiActorBlueprintEditor editor) : base(editor, 0) { brushModes.Add(new ObiFloatPaintBrushMode(this)); brushModes.Add(new ObiFloatAddBrushMode(this)); brushModes.Add(new ObiFloatSmoothBrushMode(this)); }
public ObiBlueprintRenderMode(ObiActorBlueprintEditor editor) { this.editor = editor; }
public ObiBlueprintRenderModeParticles(ObiActorBlueprintEditor editor) : base(editor) { impostorDrawer = new ParticleImpostorRendering(); impostorDrawer.UpdateMeshes(editor.blueprint); }
public ObiBlueprintRenderModeTetherConstraints(ObiActorBlueprintEditor editor) : base(editor) { }
public ObiBlueprintColor(ObiActorBlueprintEditor editor) : base(editor) { brushModes.Add(new ObiColorPaintBrushMode(this)); brushModes.Add(new ObiColorSmoothBrushMode(this)); }
public ObiBlueprintSkinBackstop(ObiActorBlueprintEditor editor) : base(editor) { brushModes.Add(new ObiFloatPaintBrushMode(this)); brushModes.Add(new ObiFloatAddBrushMode(this)); brushModes.Add(new ObiFloatSmoothBrushMode(this)); }
public ObiBlueprintFloatProperty(ObiActorBlueprintEditor editor, float?minValue = null, float?maxValue = null) { this.editor = editor; this.minValue = minValue; this.maxValue = maxValue; }
public ObiBlueprintEditorTool(ObiActorBlueprintEditor editor) { this.editor = editor; }
public ObiBlueprintColorProperty(ObiActorBlueprintEditor editor) { this.editor = editor; }