Beispiel #1
0
        private void ClearSpline(bool removePrefabInstances)
        {
            editorTarget.splineSettings.controlPoints.Clear();

            if (removePrefabInstances)
            {
                foreach (GameObject go in editorTarget.splineSettings.prefabInstances)
                {
                    PrefabPainter.DestroyImmediate(go);
                }
            }

            editorTarget.splineSettings.prefabInstances.Clear();

            editorTarget.splineSettings.controlPoints.Clear();

            editorTarget.splineSettings.dirty = true;
        }
        private void RemovePrefabInstances(int startIndex)
        {
            // startIndex might be -1 if there are no prefabs; prefabInstanceIndex would be -1
            // also needed if you delete control points and only 1 is left
            if (startIndex < 0)
            {
                RemoveAllPrefabInstances();
                return;
            }

            // clear existing prefabs
            for (int i = prefabPainter.splineSettings.prefabInstances.Count - 1; i >= startIndex; i--)
            {
                GameObject prefab = prefabPainter.splineSettings.prefabInstances[i];

                PrefabPainter.DestroyImmediate(prefab);

                prefabPainter.splineSettings.prefabInstances.RemoveAt(i);
            }
        }
 public ToolsExtension(PrefabPainterEditor editor)
 {
     this.editor       = editor;
     this.editorTarget = editor.GetPainter();
 }
Beispiel #4
0
 public SelectionExtension(PrefabPainterEditor editor)
 {
     this.editor       = editor;
     this.editorTarget = editor.GetPainter();
 }
 public SplineModule(PrefabPainter prefabPainter)
 {
     this.prefabPainter = prefabPainter;
 }
Beispiel #6
0
        #pragma warning restore 0414

        public ContainerModuleEditor(PrefabPainterEditor editor)
        {
            this.editor       = editor;
            this.editorTarget = editor.GetPainter();
        }
 public CopyPasteExtension(PrefabPainterEditor editor)
 {
     this.editor       = editor;
     this.editorTarget = editor.GetPainter();
 }
Beispiel #8
0
 public BrushDistribution(BrushModuleEditor brushModuleEditor)
 {
     this.brushModuleEditor = brushModuleEditor;
     this.editorTarget      = brushModuleEditor.GetPainter();
 }