mirror of
https://github.com/Xevion/procedural-placement.git
synced 2025-12-07 16:08:09 -06:00
figuring out how CustomEditor works, more comments expanding on how the Editor should function
This commit is contained in:
@@ -3,11 +3,6 @@ using System.Collections.Generic;
|
|||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
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
|
// The Point Rendering Editor must allow simple and easy adjustments of the points
|
||||||
// allowing complete control over when and how points are generated.
|
// 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)
|
// - Point Generation can be turned off and be done manually (or automatically, when changes are detected)
|
||||||
@@ -20,9 +15,29 @@ public class SamplingEditor : Editor
|
|||||||
// - Limits for negative values
|
// - Limits for negative values
|
||||||
// - Safeguards for dangerous/laggy values, possibly?
|
// - Safeguards for dangerous/laggy values, possibly?
|
||||||
|
|
||||||
PointRendering pr = (PointRendering) target;
|
// Attributes
|
||||||
|
// Random Seed
|
||||||
|
// Sampling Method
|
||||||
|
// Number of Points (Only for 'Random' Sampling Method)
|
||||||
|
// Sphere Display Size
|
||||||
|
// Point Minimum Radius (Only for 'Poisson' and 'Improved Poisson' Sampling Methods)
|
||||||
|
// Point Retry Attempts (Only for 'Poisson' and 'Improved Poisson' Sampling Methods)
|
||||||
|
// Draw Sphere?
|
||||||
|
// Draw Parent Lines? (Only for 'Poisson' and 'Improved Poisson' Sampling Methods)
|
||||||
|
// Randomize Seed?
|
||||||
|
// Generate Button
|
||||||
|
// Generation Time / Point Count
|
||||||
|
|
||||||
|
[CustomEditor(typeof(PointRendering))]
|
||||||
|
public class SamplingEditor : Editor
|
||||||
|
{
|
||||||
|
public override void OnInspectorGUI()
|
||||||
|
{
|
||||||
|
|
||||||
|
PointRendering points = (PointRendering) target;
|
||||||
DrawDefaultInspector();
|
DrawDefaultInspector();
|
||||||
|
|
||||||
EditorGUILayout.HelpBox("This is a help box", MessageType.Info);
|
if(points.samplingMethod == SamplingTypes.Random)
|
||||||
|
EditorGUILayout.HelpBox($"You are using the \"{points.samplingMethod}\" Sampling Method!", MessageType.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user