forked from keijiro/Swarm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
175 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Swarm - Special renderer that draws a swarm of wobbling/crawling tubes. | ||
// https://github.com/keijiro/Swarm | ||
|
||
using UnityEngine; | ||
using UnityEditor; | ||
|
||
namespace Swarm | ||
{ | ||
// Custom inspector for CrawlerSwarm | ||
[CustomEditor(typeof(CrawlerSwarm)), CanEditMultipleObjects] | ||
public class CrawlerSwarmEditor : Editor | ||
{ | ||
SerializedProperty _instanceCount; | ||
|
||
SerializedProperty _template; | ||
SerializedProperty _radius; | ||
SerializedProperty _material; | ||
SerializedProperty _gradient; | ||
|
||
SerializedProperty _speed; | ||
SerializedProperty _volume; | ||
SerializedProperty _constraint; | ||
SerializedProperty _noiseFrequency; | ||
SerializedProperty _noiseMotion; | ||
|
||
void OnEnable() | ||
{ | ||
_instanceCount = serializedObject.FindProperty("_instanceCount"); | ||
|
||
_template = serializedObject.FindProperty("_template"); | ||
_radius = serializedObject.FindProperty("_radius"); | ||
_material = serializedObject.FindProperty("_material"); | ||
_gradient = serializedObject.FindProperty("_gradient"); | ||
|
||
_speed = serializedObject.FindProperty("_speed"); | ||
_volume = serializedObject.FindProperty("_volume"); | ||
_constraint = serializedObject.FindProperty("_constraint"); | ||
_noiseFrequency = serializedObject.FindProperty("_noiseFrequency"); | ||
_noiseMotion = serializedObject.FindProperty("_noiseMotion"); | ||
} | ||
|
||
public override void OnInspectorGUI() | ||
{ | ||
serializedObject.Update(); | ||
|
||
EditorGUILayout.PropertyField(_instanceCount); | ||
|
||
EditorGUILayout.Space(); | ||
|
||
EditorGUILayout.PropertyField(_template); | ||
EditorGUILayout.PropertyField(_radius); | ||
EditorGUILayout.PropertyField(_material); | ||
EditorGUILayout.PropertyField(_gradient); | ||
|
||
EditorGUILayout.Space(); | ||
|
||
EditorGUILayout.PropertyField(_speed); | ||
EditorGUILayout.PropertyField(_volume); | ||
EditorGUILayout.PropertyField(_constraint); | ||
EditorGUILayout.PropertyField(_noiseFrequency); | ||
EditorGUILayout.PropertyField(_noiseMotion); | ||
|
||
serializedObject.ApplyModifiedProperties(); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters