MegaScaleEditor.cs 1018 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using UnityEngine;
  2. using UnityEditor;
  3. [CanEditMultipleObjects, CustomEditor(typeof(MegaScale))]
  4. public class MegaScaleEditor : MegaModifierEditor
  5. {
  6. public override string GetHelpString() { return "Scale Modifier by Chris West"; }
  7. public override Texture LoadImage() { return (Texture)EditorGUIUtility.LoadRequired("MegaFiers\\skew_help.png"); }
  8. public override void OnInspectorGUI()
  9. {
  10. MegaScale mod = (MegaScale)target;
  11. // Basic mod stuff
  12. showmodparams = EditorGUILayout.Foldout(showmodparams, "Modifier Common Params");
  13. if ( showmodparams )
  14. {
  15. CommonModParamsBasic(mod);
  16. }
  17. mod.scale = EditorGUILayout.Vector3Field("Scale", mod.scale);
  18. if ( GUI.changed )
  19. EditorUtility.SetDirty(target);
  20. }
  21. #if false
  22. public override bool Inspector()
  23. {
  24. MegaScale mod = (MegaScale)target;
  25. #if !UNITY_5 && !UNITY_2017 && !UNITY_2018 && !UNITY_2019 && !UNITY_2020
  26. EditorGUIUtility.LookLikeControls();
  27. #endif
  28. mod.scale = EditorGUILayout.Vector3Field("Scale", mod.scale);
  29. return false;
  30. }
  31. #endif
  32. }