private bool DrawOne(TweenerBase tween, int i = -1) { EditorGUILayout.BeginHorizontal(); tween.editorOpen = EditorGUILayout.Foldout( tween.editorOpen, tween.GetType().Name, true); if (i > -1 && GUILayout.Button("-", GUILayout.Width(25))) { tweener.Remove(i); return(false); } EditorGUILayout.EndHorizontal(); if (!tween.editorOpen) { return(true); } tween.EditorObjectField(); tween.EditorValueFields(); Element(tween); return(true); }
private static void Easing(TweenerBase tween) { tween.drawEasing = EditorGUILayout.Toggle("Draw Easing", tween.drawEasing); if (tween.drawEasing) { AnimationCurve curve = EditorGUILayout.CurveField("Easing", tween.Curve ?? new AnimationCurve()); tween.Curve = curve; } tween.Curve = null; }
private static void Element(TweenerBase tween) { tween.Delay = EditorGUILayout.FloatField( "Delay", tween.Delay); tween.Duration = EditorGUILayout.FloatField( "Duration", tween.Duration); tween.Time = EditorGUILayout.FloatField( "Current Time", tween.Time); tween.loop = (TweenerBase.LoopType)EditorGUILayout.EnumPopup("Loop", tween.loop); EditorGUILayout.BeginHorizontal(); Easing(tween); EditorGUILayout.EndHorizontal(); }