public void OnEnable() { skinMap = (ObiTriangleSkinMap)target; barycentricWeight = serializedObject.FindProperty("barycentricWeight"); normalAlignmentWeight = serializedObject.FindProperty("normalAlignmentWeight"); elevationWeight = serializedObject.FindProperty("elevationWeight"); paintBrush = new ObiRaycastBrush(skinMap.slave, () => { // As RecordObject diffs with the end of the current frame, // and this is a multi-frame operation, we need to use RegisterCompleteObjectUndo instead. Undo.RegisterCompleteObjectUndo(skinMap, "Paint skin channel"); }, () => { SceneView.RepaintAll(); }, () => { EditorUtility.SetDirty(skinMap); }); currentProperty = new ObiSkinMapChannel(this); paintBrush.brushMode = new ObiMasterSlavePaintBrushMode(currentProperty); Selection.selectionChanged += OnSelectionChange; }
public ObiPaintBrushEditorTool(ObiMeshBasedActorBlueprintEditor editor) : base(editor) { m_Icon = Resources.Load <Texture2D>("BrushIcon"); m_Name = "Property painting"; paintBrush = new ObiRaycastBrush(editor.sourceMesh, () => { // As RecordObject diffs with the end of the current frame, // and this is a multi-frame operation, we need to use RegisterCompleteObjectUndo instead. Undo.RegisterCompleteObjectUndo(editor.blueprint, "Paint particles"); }, () => { editor.Refresh(); }, () => { EditorUtility.SetDirty(editor.blueprint); }); }