Ejemplo n.º 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;
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
 public ToolsExtension(PrefabPainterEditor editor)
 {
     this.editor       = editor;
     this.editorTarget = editor.GetPainter();
 }
Ejemplo n.º 4
0
 public SelectionExtension(PrefabPainterEditor editor)
 {
     this.editor       = editor;
     this.editorTarget = editor.GetPainter();
 }
Ejemplo n.º 5
0
 public SplineModule(PrefabPainter prefabPainter)
 {
     this.prefabPainter = prefabPainter;
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 8
0
 public BrushDistribution(BrushModuleEditor brushModuleEditor)
 {
     this.brushModuleEditor = brushModuleEditor;
     this.editorTarget      = brushModuleEditor.GetPainter();
 }