protected override void CustomInspectorGUI() { TweenCameraSize tTransp = (TweenCameraSize)tween; EditorGUILayout.BeginHorizontal(); EditorTools.DrawLabel("Begin Size", true, GUILayout.Width(150f)); tTransp.beginSize = EditorGUILayout.FloatField(tTransp.beginSize, GUILayout.MinWidth(150f)); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorTools.DrawLabel("End Size", true, GUILayout.Width(150f)); tTransp.endSize = EditorGUILayout.FloatField(tTransp.endSize, GUILayout.MinWidth(150f)); EditorGUILayout.EndHorizontal(); }
public static TweenCameraSize AddTween(GameObject target, float from, float to, float duration, Keyframe[] keys) { TweenCameraSize tweener = target.AddComponent <TweenCameraSize>(); tweener.Target = target; tweener.From = from; tweener.To = to; tweener.Duration = duration; tweener.Curve = new AnimationCurve(); tweener.Curve.keys = keys; tweener.Initialise(); return(tweener); }