MegaWarpBindEditor.cs 838 B

12345678910111213141516171819202122232425262728293031
  1. using UnityEngine;
  2. using UnityEditor;
  3. [CanEditMultipleObjects, CustomEditor(typeof(MegaWarpBind))]
  4. public class MegaWarpBindEditor : MegaModifierEditor
  5. {
  6. public override string GetHelpString() { return "Warp Bind Modifier by Chris West"; }
  7. public GameObject SourceWarpObj; // TODO: or point at mod on the warp
  8. GameObject current;
  9. public float decay = 0.0f;
  10. public override bool Inspector()
  11. {
  12. MegaWarpBind mod = (MegaWarpBind)target;
  13. #if !UNITY_5 && !UNITY_2017 && !UNITY_2018 && !UNITY_2019 && !UNITY_2020
  14. EditorGUIUtility.LookLikeControls();
  15. #endif
  16. GameObject go = (GameObject)EditorGUILayout.ObjectField("Warp Object", mod.SourceWarpObj, typeof(GameObject), true);
  17. //if ( go != mod.SourceWarpObj )
  18. {
  19. mod.SetTarget(go);
  20. }
  21. mod.decay = EditorGUILayout.FloatField("Decay", mod.decay);
  22. return false;
  23. }
  24. }