Example #1
0
        /// <summary>
        /// Start the tweening operation.
        /// </summary>

        static public TweenFOV Begin(GameObject go, float duration, float to)
        {
            TweenFOV comp = UITweener.Begin <TweenFOV>(go, duration);

            comp.from = comp.value;
            comp.to   = to;

            if (duration <= 0f)
            {
                comp.Sample(1f, true);
                comp.enabled = false;
            }
            return(comp);
        }
Example #2
0
        public override void OnInspectorGUI()
        {
            GUILayout.Space(6f);
            TweenKitEditorTools.SetLabelWidth(120f);

            TweenFOV tw = target as TweenFOV;

            GUI.changed = false;

            float from = EditorGUILayout.Slider("From", tw.from, 1f, 180f);
            float to   = EditorGUILayout.Slider("To", tw.to, 1f, 180f);

            if (GUI.changed)
            {
                TweenKitEditorTools.RegisterUndo("Tween Change", tw);
                tw.from = from;
                tw.to   = to;
                TweenKitTools.SetDirty(tw);
            }

            DrawCommonProperties();
        }