diff --git a/procedural-placement/Assets/PointRendering.cs b/procedural-placement/Assets/PointRendering.cs index d687ef8..5a44cb7 100644 --- a/procedural-placement/Assets/PointRendering.cs +++ b/procedural-placement/Assets/PointRendering.cs @@ -1,9 +1,6 @@ using System; using System.Collections.Generic; -using System.Net; -using UnityEditor; using UnityEngine; -using UnityEngine.Serialization; public enum SamplingTypes { Random, diff --git a/procedural-placement/Assets/SamplingEditor.cs b/procedural-placement/Assets/SamplingEditor.cs new file mode 100644 index 0000000..23c9a4d --- /dev/null +++ b/procedural-placement/Assets/SamplingEditor.cs @@ -0,0 +1,28 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +[CustomEditor(typeof(PointRendering))] +public class SamplingEditor : Editor +{ + public override void OnInspectorGUI() + { + // The Point Rendering Editor must allow simple and easy adjustments of the points + // allowing complete control over when and how points are generated. + // - Point Generation can be turned off and be done manually (or automatically, when changes are detected) + // - Sampling Methods can change, and different fields will be visible depending on the active sampling method. + // - 'Random' requires no 'Radius' or 'Retry Attempts' field + // - 'Poisson' and 'Improved Poisson' require no 'Num Points' field (but they should have a text area) + // - A 'seed' field should be given, a checkbox for seed auto re-picking (edits of other fields can cause said seed to be randomized, + // allowing one to observe the effect of different sampling methods or arguments with the same seed being used.) + // - A simple text field showing how many points were generated and how long it took to do so. + // - Limits for negative values + // - Safeguards for dangerous/laggy values, possibly? + + PointRendering pr = (PointRendering) target; + DrawDefaultInspector(); + + EditorGUILayout.HelpBox("This is a help box", MessageType.Info); + } +} diff --git a/procedural-placement/Assets/SamplingEditor.cs.meta b/procedural-placement/Assets/SamplingEditor.cs.meta new file mode 100644 index 0000000..60f94cd --- /dev/null +++ b/procedural-placement/Assets/SamplingEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3f824584e6118704c99fc0c09497f661 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/procedural-placement/Assets/Scenes/SampleScene.unity b/procedural-placement/Assets/Scenes/SampleScene.unity index d999b48..9ca0ea0 100644 --- a/procedural-placement/Assets/Scenes/SampleScene.unity +++ b/procedural-placement/Assets/Scenes/SampleScene.unity @@ -149,12 +149,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 95149e3ad64fa7149affeaeb9f8e273b, type: 3} m_Name: m_EditorClassIdentifier: - samplingMethod: 1 - numPoints: 23 - sphereSize: 4.3 - regionSize: {x: 1945, y: 1000} - radius: 266.86 - retryAttempts: 1503 + samplingMethod: 2 + numPoints: 14878 + sphereSize: 0.4 + regionSize: {x: 194, y: 100} + radius: 1 + retryAttempts: 10 drawSphere: 0 --- !u!4 &2048189740 Transform: