private void ClearSpline(bool removePrefabInstances)
        {
            gizmo.splineSettings.controlPoints.Clear();

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

            gizmo.splineSettings.prefabInstances.Clear();

            gizmo.splineSettings.controlPoints.Clear();
        }
Esempio n. 2
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;
        }
Esempio n. 3
0
        public BrushModuleEditor(PrefabPainterEditor editor)
        {
            this.editor = editor;
            this.gizmo  = editor.GetPainter();

            brushSize     = editor.FindProperty(x => x.brushSettings.brushSize);
            brushRotation = editor.FindProperty(x => x.brushSettings.brushRotation);

            alignToTerrain    = editor.FindProperty(x => x.brushSettings.alignToTerrain);
            distribution      = editor.FindProperty(x => x.brushSettings.distribution);
            poissonDiscSize   = editor.FindProperty(x => x.brushSettings.poissonDiscSize);
            fallOffCurve      = editor.FindProperty(x => x.brushSettings.fallOffCurve);
            fallOff2dCurveX   = editor.FindProperty(x => x.brushSettings.fallOff2dCurveX);
            fallOff2dCurveZ   = editor.FindProperty(x => x.brushSettings.fallOff2dCurveZ);
            curveSamplePoints = editor.FindProperty(x => x.brushSettings.curveSamplePoints);
            allowOverlap      = editor.FindProperty(x => x.brushSettings.allowOverlap);

            spawnToVSPro = editor.FindProperty(x => x.brushSettings.spawnToVSPro);
        }
Esempio n. 4
0
        public PhysicsExtension(PrefabPainterEditor editor)
        {
            this.editor = editor;
            this.gizmo  = editor.GetPainter();

            forceApplyType      = editor.FindProperty(x => x.physicsSettings.forceApplyType);
            maxIterations       = editor.FindProperty(x => x.physicsSettings.maxIterations);
            forceMinMax         = editor.FindProperty(x => x.physicsSettings.forceMinMax);
            forceAngleInDegrees = editor.FindProperty(x => x.physicsSettings.forceAngleInDegrees);
            randomizeForceAngle = editor.FindProperty(x => x.physicsSettings.randomizeForceAngle);
            simulationRunning   = editor.FindProperty(x => x.physicsSettings.simulationRunning);
            simulationStepCount = editor.FindProperty(x => x.physicsSettings.simulationStepCount);

            if (physicsSimulation == null)
            {
                physicsSimulation = ScriptableObject.CreateInstance <PhysicsSimulation>();
            }
            physicsSimulation.ApplySettings(gizmo.physicsSettings);
        }
Esempio n. 5
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);
            }
        }
Esempio n. 6
0
        public BrushModuleEditor(PrefabPainterEditor editor)
        {
            this.editor       = editor;
            this.editorTarget = editor.GetPainter();


            brushSize     = editor.FindProperty(x => x.brushSettings.brushSize);
            brushRotation = editor.FindProperty(x => x.brushSettings.brushRotation);

            alignToTerrain    = editor.FindProperty(x => x.brushSettings.alignToTerrain);
            distribution      = editor.FindProperty(x => x.brushSettings.distribution);
            poissonDiscSize   = editor.FindProperty(x => x.brushSettings.poissonDiscSize);
            fallOffCurve      = editor.FindProperty(x => x.brushSettings.fallOffCurve);
            fallOff2dCurveX   = editor.FindProperty(x => x.brushSettings.fallOff2dCurveX);
            fallOff2dCurveZ   = editor.FindProperty(x => x.brushSettings.fallOff2dCurveZ);
            curveSamplePoints = editor.FindProperty(x => x.brushSettings.curveSamplePoints);
            allowOverlap      = editor.FindProperty(x => x.brushSettings.allowOverlap);

            // initialize integrated applications
            vegetationStudioProIntegration = new VegetationStudioProIntegration(editor);
        }
Esempio n. 7
0
        #pragma warning restore 0414

        public PrefabModuleEditor(PrefabPainterEditor editor)
        {
            this.editor = editor;
            this.gizmo  = editor.GetPainter();
        }
Esempio n. 8
0
 public SplineModule(PrefabPainter prefabPainter)
 {
     this.prefabPainter = prefabPainter;
 }
Esempio n. 9
0
 public SelectionExtension(PrefabPainterEditor editor)
 {
     this.editor = editor;
     this.gizmo  = editor.GetPainter();
 }
Esempio n. 10
0
        #pragma warning restore 0414

        public ContainerModuleEditor(PrefabPainterEditor editor)
        {
            this.editor       = editor;
            this.editorTarget = editor.GetPainter();
        }
Esempio n. 11
0
 public ToolsExtension(PrefabPainterEditor editor)
 {
     this.editor       = editor;
     this.editorTarget = editor.GetPainter();
 }
Esempio n. 12
0
 public CopyPasteExtension(PrefabPainterEditor editor)
 {
     this.editor = editor;
     this.gizmo  = editor.GetPainter();
 }