MegaNoiseWarpEditor.cs 1.2 KB

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