Пример #1
0
    public void TweenPosition(float duration, Vector3 pos, Tweener.Method method, bool steeperCurves)
    {
        PositionTween tweenPosition = PositionTween.Begin(gameObject, duration, pos);

        tweenPosition.method        = method;
        tweenPosition.steeperCurves = steeperCurves;
    }
Пример #2
0
    public static void TweenColor(GameObject go, float duration, Color color, Tweener.Method method)
    {
        if (go.activeSelf && go.renderer != null)
        {
            ColorTween tweenColor = ColorTween.Begin(go, duration, color);
            tweenColor.method = method;
            if (duration == 0)
            {
                tweenColor.color = color;
            }
        }

        for (int i = 0; i < go.transform.childCount; i++)
        {
            TweenColor(go.transform.GetChild(i).gameObject, duration, color, method);
        }
    }
Пример #3
0
        protected void DrawCommonProperties()
        {
            Tweener tw = target as Tweener;

            if (EditorTools.DrawHeader("Tweener"))
            {
                EditorTools.BeginContents();
                EditorTools.SetLabelWidth(110f);

                GUI.changed = false;

                Tweener.Style  style  = (Tweener.Style)EditorGUILayout.EnumPopup("Play Style", tw.PlayStyle);
                AnimationCurve curve  = EditorGUILayout.CurveField("ExplotionAnimator Curve", tw.PlayAnimationCurve, GUILayout.Width(170f), GUILayout.Height(62f));
                Tweener.Method method = (Tweener.Method)EditorGUILayout.EnumPopup("Play Method", tw.PlayMethod);

                GUILayout.BeginHorizontal();
                float dur = EditorGUILayout.FloatField("Duration", tw.Duration, GUILayout.Width(170f));
                GUILayout.Label("seconds");
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                float del = EditorGUILayout.FloatField("Start Delay", tw.Delay, GUILayout.Width(170f));
                GUILayout.Label("seconds");
                GUILayout.EndHorizontal();

                if (GUI.changed)
                {
                    EditorTools.RegisterUndo("Tween Change", tw);
                    tw.PlayAnimationCurve = curve;
                    tw.PlayMethod         = method;
                    tw.PlayStyle          = style;
                    tw.Duration           = dur;
                    tw.Delay = del;
                }
                EditorTools.EndContents();
            }

            //EditorTools.SetLabelWidth(80f);
            //EditorTools.DrawEvents("On Finished", tw, tw.onFinished);
        }
Пример #4
0
 public void TweenColor(float duration, Color color, Tweener.Method method)
 {
     Effects.TweenColor(gameObject, duration, color, method);
 }
Пример #5
0
    public void TweenScale(float duration, Vector3 scale, Tweener.Method method)
    {
        ScaleTween tweenScale = ScaleTween.Begin(gameObject, duration, scale);

        tweenScale.method = method;
    }