#if UNITY_EDITOR using UnityEngine; using UnityEditor; using System.Collections; namespace MoreMountains.Tools { /// /// This class adds names for each LevelMapPathElement next to it on the scene view, for easier setup /// [CustomEditor(typeof(MMPathMovement),true)] [InitializeOnLoad] public class MMPathMovementEditor : Editor { public MMPathMovement pathMovementTarget { get { return (MMPathMovement)target; } } public override void OnInspectorGUI() { serializedObject.Update (); if (pathMovementTarget.AccelerationType == MMPathMovement.PossibleAccelerationType.AnimationCurve) { DrawDefaultInspector (); } else { Editor.DrawPropertiesExcluding (serializedObject, new string [] { "Acceleration" }); } serializedObject.ApplyModifiedProperties (); } /// /// OnSceneGUI, draws repositionable handles at every point in the path, for easier setup /// protected virtual void OnSceneGUI() { Handles.color = Color.green; MMPathMovement t = (target as MMPathMovement); if (t.GetOriginalTransformPositionStatus() == false) { return; } for (int i=0;i