MegaPointCacheRefEditor.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. 
  2. using UnityEngine;
  3. using UnityEditor;
  4. using System.IO;
  5. using System.Collections.Generic;
  6. // Support anim uvs here as well
  7. [CanEditMultipleObjects, CustomEditor(typeof(MegaPointCacheRef))]
  8. public class MegaPointCacheRefEditor : MegaModifierEditor
  9. {
  10. public override void OnInspectorGUI()
  11. {
  12. MegaPointCacheRef am = (MegaPointCacheRef)target;
  13. // Basic mod stuff
  14. showmodparams = EditorGUILayout.Foldout(showmodparams, "Modifier Common Params");
  15. if ( showmodparams )
  16. CommonModParamsBasic(am);
  17. am.source = (MegaPointCache)EditorGUILayout.ObjectField("Source", am.source, typeof(MegaPointCache), true);
  18. am.time = EditorGUILayout.FloatField("Time", am.time);
  19. am.maxtime = EditorGUILayout.FloatField("Loop Time", am.maxtime);
  20. am.animated = EditorGUILayout.Toggle("Animated", am.animated);
  21. am.speed = EditorGUILayout.FloatField("Speed", am.speed);
  22. am.LoopMode = (MegaRepeatMode)EditorGUILayout.EnumPopup("Loop Mode", am.LoopMode);
  23. am.interpMethod = (MegaInterpMethod)EditorGUILayout.EnumPopup("Interp Method", am.interpMethod);
  24. am.blendMode = (MegaBlendAnimMode)EditorGUILayout.EnumPopup("Blend Mode", am.blendMode);
  25. if ( am.blendMode == MegaBlendAnimMode.Additive )
  26. am.weight = EditorGUILayout.FloatField("Weight", am.weight);
  27. if ( GUI.changed )
  28. EditorUtility.SetDirty(target);
  29. }
  30. }