Example #1
0
 public static void ColorTo(object obj, Color color, float duration, vp_UITween.Handle handle, Action onComplete)
 {
     ColorTo(obj, vp_UITween.Hash("color", color, "duration", duration, "handle", handle, "onComplete", onComplete));
 }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the vp_UITween.tween
        /// class and will set values from parameters provided
        /// </summary>
        public Tween(object obj, params object[] parameters)
        {
            Object = obj;

            for (int i = 0; i < parameters.Length; i++)
            {
                object o = parameters[i];
                if ((i % 2) == 0)
                {
                    object value = parameters[i + 1];
                    if (((string)o) == "duration")
                    {
                        Duration = Convert.ToSingle(value);
                    }
                    if (((string)o) == "startColor")
                    {
                        StartColor = (Color)value;
                    }
                    if (((string)o) == "endColor")
                    {
                        EndColor = (Color)value;
                    }
                    if (((string)o) == "scale")
                    {
                        EndScale = (Vector3)value;
                    }
                    if (((string)o) == "rotation")
                    {
                        EndRotation = (Quaternion)value;
                    }
                    if (((string)o) == "handle")
                    {
                        Handle = (vp_UITween.Handle)value;
                    }
                    if (((string)o) == "onComplete")
                    {
                        Callback = (Action)value;
                    }
                    if (((string)o) == "type")
                    {
                        Type = (vp_UITween.vp_UITweenType)value;
                    }
                }
            }
            if (Handle != null)
            {
                Handle.Custom = true;
            }

            if (Handle == null)
            {
                Handle = new Handle();
            }

            Handle.TweenObject = this;

            if (obj.GetType() == typeof(GameObject))
            {
                GameObject go = (GameObject)obj;
                Transform  = go.transform;
                Name       = go.name;
                StartScale = Transform.localScale;
            }
        }
Example #3
0
 public static void FadeTo(object obj, float alpha, float duration, vp_UITween.Handle handle)
 {
     ColorTo(obj, vp_UITween.Hash("color", alpha, "duration", duration, "handle", handle, "onComplete", null));
 }