예제 #1
0
    void OnDisable()
    {
        if (mStarted && tweenTarget != null)
        {
            CustomTweenScale tc = tweenTarget.GetComponent <CustomTweenScale>();

            if (tc != null)
            {
                tc.value   = mScale;
                tc.enabled = false;
            }
        }
    }
예제 #2
0
    /// <summary>
    /// 开始补间操作
    /// </summary>
    static public CustomTweenScale Begin(GameObject go, float duration, Vector3 scale)
    {
        CustomTweenScale comp = CustomUITweener.Begin <CustomTweenScale>(go, duration);

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

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

        CustomTweenScale tw = target as CustomTweenScale;

        GUI.changed = false;

        Vector3 from  = EditorGUILayout.Vector3Field("From", tw.from);
        Vector3 to    = EditorGUILayout.Vector3Field("To", tw.to);
        bool    table = EditorGUILayout.Toggle("Update Table", tw.updateTable);

        if (GUI.changed)
        {
            CustomUITweenEditorTools.RegisterUndo("Tween Change", tw);
            tw.from        = from;
            tw.to          = to;
            tw.updateTable = table;
            CustomUITweenTools.SetDirty(tw);
        }

        DrawCommonProperties();
    }
예제 #4
0
 void Scale(Vector3 to)
 {
     CustomTweenScale.Begin(tweenTarget.gameObject, duration, to).easeType = EaseType.linear;
 }