MegaNoiseEditor.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. using UnityEngine;
  2. using UnityEditor;
  3. [CanEditMultipleObjects, CustomEditor(typeof(MegaNoise))]
  4. public class MegaNoiseEditor : MegaModifierEditor
  5. {
  6. public override string GetHelpString() { return "Noise Modifier by Chris West"; }
  7. public override Texture LoadImage() { return (Texture)EditorGUIUtility.LoadRequired("MegaFiers\\noise_help.png"); }
  8. public override bool Inspector()
  9. {
  10. MegaNoise mod = (MegaNoise)target;
  11. #if !UNITY_5 && !UNITY_2017 && !UNITY_2018 && !UNITY_2019 && !UNITY_2020
  12. EditorGUIUtility.LookLikeControls();
  13. #endif
  14. mod.Scale = EditorGUILayout.FloatField("Scale", mod.Scale);
  15. mod.Freq = EditorGUILayout.FloatField("Freq", mod.Freq);
  16. mod.Phase = EditorGUILayout.FloatField("Phase", mod.Phase);
  17. mod.Fractal = EditorGUILayout.Toggle("Fractal", mod.Fractal);
  18. if ( mod.Fractal )
  19. {
  20. mod.Iterations = EditorGUILayout.FloatField("Iterations", mod.Iterations);
  21. mod.Rough = EditorGUILayout.FloatField("Rough", mod.Rough);
  22. }
  23. mod.Strength = EditorGUILayout.Vector3Field("Strength", mod.Strength);
  24. mod.Animate = EditorGUILayout.Toggle("Animate", mod.Animate);
  25. return false;
  26. }
  27. }