#pragma warning restore 0414 public AntiGravityInteraction(PrefabPainterEditor editor) { this.editor = editor; this.editorTarget = editor.GetPainter(); antiGravityStrength = editor.FindProperty(x => x.interactionSettings.antiGravity.strength); }
private void SetScale(RaycastHit hit) { switch (editor.GetPainter().brushSettings.spawnTarget) { case BrushSettings.SpawnTarget.PrefabContainer: SetScalePrefabs(hit); break; case BrushSettings.SpawnTarget.TerrainTrees: float brushSize = editorTarget.brushSettings.brushSize; float scaleValueX = editorTarget.interactionSettings.setScale.setScaleValue; float scaleValueY = editorTarget.interactionSettings.setScale.setScaleValue; terrainTreeManager.SetScale(hit.point, brushSize, scaleValueX, scaleValueY); break; case BrushSettings.SpawnTarget.TerrainDetails: Debug.LogError("Not implemented"); break; case BrushSettings.SpawnTarget.VegetationStudioPro: Debug.LogError("Not implemented"); break; } }
public BrushModuleEditor(PrefabPainterEditor editor) { this.editor = editor; this.editorTarget = editor.GetPainter(); brushDistribution = new BrushDistribution(this); brushSize = editor.FindProperty(x => x.brushSettings.brushSize); brushRotation = editor.FindProperty(x => x.brushSettings.brushRotation); sizeGuide = editor.FindProperty(x => x.brushSettings.sizeGuide); normalGuide = editor.FindProperty(x => x.brushSettings.normalGuide); rotationGuide = editor.FindProperty(x => x.brushSettings.rotationGuide); alignToTerrain = editor.FindProperty(x => x.brushSettings.alignToTerrain); distribution = editor.FindProperty(x => x.brushSettings.distribution); poissonDiscSize = editor.FindProperty(x => x.brushSettings.poissonDiscSize); poissonDiscRaycastOffset = editor.FindProperty(x => x.brushSettings.poissonDiscRaycastOffset); 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); layerMask = editor.FindProperty(x => x.brushSettings.layerMask); // initialize integrated applications vegetationStudioProIntegration = new VegetationStudioProIntegration(editor); }
public SplineModuleEditor(PrefabPainterEditor editor) { this.editor = editor; this.editorTarget = editor.GetPainter(); spawnMechanism = editor.FindProperty(x => x.splineSettings.spawnMechanism); curveResolution = editor.FindProperty(x => x.splineSettings.curveResolution); loop = editor.FindProperty(x => x.splineSettings.loop); separation = editor.FindProperty(x => x.splineSettings.separation); separationDistance = editor.FindProperty(x => x.splineSettings.separationDistance); separationDistanceMin = editor.FindProperty(x => x.splineSettings.separationDistanceMin); separationDistanceMax = editor.FindProperty(x => x.splineSettings.separationDistanceMax); lanes = editor.FindProperty(x => x.splineSettings.lanes); laneDistance = editor.FindProperty(x => x.splineSettings.laneDistance); skipCenterLane = editor.FindProperty(x => x.splineSettings.skipCenterLane); instanceRotation = editor.FindProperty(x => x.splineSettings.instanceRotation); controlPointRotation = editor.FindProperty(x => x.splineSettings.controlPointRotation); attachMode = editor.FindProperty(x => x.splineSettings.attachMode); reusePrefabs = editor.FindProperty(x => x.splineSettings.reusePrefabs); snap = editor.FindProperty(x => x.splineSettings.snap); debug = editor.FindProperty(x => x.splineSettings.debug); controlPoints = editor.FindProperty(x => x.splineSettings.controlPoints); dirty = editor.FindProperty(x => x.splineSettings.dirty); }
public void AddNewPrefab(PrefabSettings prefabSettings, Vector3 newPosition, Quaternion newRotation, Vector3 newLocalScale) { // brush mode float brushSize = editor.GetPainter().brushSettings.brushSize; // poisson mode: use the discs as brush size if (editor.GetPainter().brushSettings.distribution == BrushSettings.Distribution.Poisson_Any || editor.GetPainter().brushSettings.distribution == BrushSettings.Distribution.Poisson_Terrain) { brushSize = editor.GetPainter().brushSettings.poissonDiscSize; } GameObject prefab = prefabSettings.prefab; bool allowOverlap = editor.GetPainter().brushSettings.allowOverlap; terrainTreeManager.PlacePrefab(prefab, newPosition, newLocalScale, newRotation, brushSize, randomTreeColor, treeColorAdjustment, allowOverlap); }
#pragma warning restore 0414 public MagnetInteraction(PrefabPainterEditor editor) { this.editor = editor; this.editorTarget = editor.GetPainter(); strength = editor.FindProperty(x => x.interactionSettings.magnet.strength); }
public PrefabModuleEditor(PrefabPainterEditor editor) { this.editor = editor; this.editorTarget = editor.GetPainter(); LoadTemplateCollection(); }
public SpawnExtension(PrefabPainterEditor editor) { this.editor = editor; this.editorTarget = editor.GetPainter(); autoSimulationType = editor.FindProperty(x => x.spawnSettings.autoSimulationType); autoSimulationHeightOffset = editor.FindProperty(x => x.spawnSettings.autoSimulationHeightOffset); }
public void OnInspectorGUI() { // show the spawn target in bold EditorStyles.helpBox.richText = true; EditorGUILayout.HelpBox(new GUIContent("Using target <b>" + editor.GetPainter().brushSettings.spawnTarget + "</b>")); EditorStyles.helpBox.richText = false; EditorGUILayout.HelpBox(new GUIContent("Shift = Grow, Ctrl+Shift = Shrink")); GUILayout.BeginVertical("box"); EditorGUILayout.LabelField("Change Scale", GUIStyles.BoxTitleStyle); EditorGUILayout.PropertyField(changeScaleStrength, new GUIContent("Strength", "Strength of the scale adjustment")); GUILayout.EndVertical(); }
public FilterExtension(PrefabPainterEditor editor) { this.editor = editor; this.editorTarget = editor.GetPainter(); layerFilterEnabled = editor.FindProperty(x => x.filterSettings.layerFilterEnabled); includeTextures = editor.FindProperty(x => x.filterSettings.includes); excludesTextures = editor.FindProperty(x => x.filterSettings.excludes); }
private bool needsPhysicsApplied = false; // TODO property public InteractionModuleEditor(PrefabPainterEditor editor) { this.editor = editor; this.editorTarget = editor.GetPainter(); interactionType = editor.FindProperty(x => x.interactionSettings.interactionType); antiGravityStrength = editor.FindProperty(x => x.interactionSettings.antiGravityStrength); magnetStrength = editor.FindProperty(x => x.interactionSettings.magnetStrength); }
public SetScaleInteraction(PrefabPainterEditor editor) { this.editor = editor; this.editorTarget = editor.GetPainter(); terrainTreeManager = new UnityTerrainTreeManager(editor); setScaleValue = editor.FindProperty(x => x.interactionSettings.setScale.setScaleValue); }
public ChangeScaleInteraction(PrefabPainterEditor editor) { this.editor = editor; this.editorTarget = editor.GetPainter(); terrainTreeManager = new UnityTerrainTreeManager(editor); changeScaleStrength = editor.FindProperty(x => x.interactionSettings.changeScale.changeScaleStrength); }
private Terrain GetTerrain() { Terrain terrain = editor.GetPainter().brushSettings.targetTerrain; if (terrain == null) { Debug.LogError("Terrain not found"); } return(terrain); }
public InteractionModuleEditor(PrefabPainterEditor editor) { this.editor = editor; this.editorTarget = editor.GetPainter(); interactionType = editor.FindProperty(x => x.interactionSettings.interactionType); antiGravityModule = new AntiGravityInteraction(editor); magnetModule = new MagnetInteraction(editor); changeScaleModule = new ChangeScaleInteraction(editor); setScaleModule = new SetScaleInteraction(editor); }
public PhysicsExtension(PrefabPainterEditor editor) { this.editor = editor; this.editorTarget = 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); simulationTime = editor.FindProperty(x => x.physicsSettings.simulationTime); simulationSteps = editor.FindProperty(x => x.physicsSettings.simulationSteps); }
public CopyPasteExtension(PrefabPainterEditor editor) { this.editor = editor; this.editorTarget = editor.GetPainter(); }
public ToolsExtension(PrefabPainterEditor editor) { this.editor = editor; this.editorTarget = editor.GetPainter(); }
public SelectionExtension(PrefabPainterEditor editor) { this.editor = editor; this.editorTarget = editor.GetPainter(); }
/// <summary> /// Remove all prefab settings /// </summary> public void ClearPrefabs() { editor.GetPainter().prefabSettingsList.Clear(); }
#pragma warning restore 0414 public ContainerModuleEditor(PrefabPainterEditor editor) { this.editor = editor; this.editorTarget = editor.GetPainter(); }