Esempio n. 1
0
        /// <summary>
        /// Move gameobject transform from start to end position
        /// </summary>
        /// <param name="gO"></param>
        /// <param name="startPosition"></param>
        /// <param name="endPosition"></param>
        /// <param name="time"></param>
        /// <returns></returns>
        public static SimpleTweenObject Move(GameObject gO, Vector3 startPosition, Vector3 endPosition, float time)
        {
            Create();
            SimpleTweenObject sTO = CreateTweenObject(gO, startPosition, endPosition, time, true);

            return(sTO);
        }
Esempio n. 2
0
        /// <summary>
        /// Tween value start to end
        /// </summary>
        /// <param name="gO"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <param name="time"></param>
        /// <returns></returns>
        public static SimpleTweenObject Value(GameObject gO, float start, float end, float time)
        {
            Create();
            SimpleTweenObject sTO = CreateTweenObject(gO, start, end, time);

            return(sTO);
        }
Esempio n. 3
0
        private static SimpleTweenObject CreateTweenObject(GameObject gO, Vector3 startPosition, Vector3 endPosition, float time, bool move)
        {
            SimpleTweenObject sTO;
            int length = tweenObjects.Count;// Debug.Log("tw length: " + length);

            for (int i = 0; i < length; i++)
            {
                if (tweenObjects[i].IsFree)
                {
                    sTO = tweenObjects[i];
                    sTO.Rebuild(gO, startPosition, endPosition, time, move);
                    return(sTO);
                }
            }
            sTO = new SimpleTweenObject(gO, startPosition, endPosition, time, move);
            tweenObjects.Add(sTO);
            return(sTO);
        }