begin work on new sampling methods editor allowing better control over point generation

This commit is contained in:
Xevion
2020-05-06 10:13:59 -05:00
parent 0bfab637f4
commit 190b248332
4 changed files with 45 additions and 9 deletions

View File

@@ -1,9 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net;
using UnityEditor;
using UnityEngine; using UnityEngine;
using UnityEngine.Serialization;
public enum SamplingTypes { public enum SamplingTypes {
Random, Random,

View File

@@ -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);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3f824584e6118704c99fc0c09497f661
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -149,12 +149,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 95149e3ad64fa7149affeaeb9f8e273b, type: 3} m_Script: {fileID: 11500000, guid: 95149e3ad64fa7149affeaeb9f8e273b, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
samplingMethod: 1 samplingMethod: 2
numPoints: 23 numPoints: 14878
sphereSize: 4.3 sphereSize: 0.4
regionSize: {x: 1945, y: 1000} regionSize: {x: 194, y: 100}
radius: 266.86 radius: 1
retryAttempts: 1503 retryAttempts: 10
drawSphere: 0 drawSphere: 0
--- !u!4 &2048189740 --- !u!4 &2048189740
Transform: Transform: