Ejemplo n.º 1
0
        public static TweenShark To(object obj, float duration, TweenOps tweenOps)
        {
            var ts = new TweenShark(obj, duration, tweenOps);

            _core.To(ts);
            return(ts);
        }
Ejemplo n.º 2
0
        public void AddTweenShark(TweenShark tweenShark)
        {
            // we can only add tweens on the same object as this instance of TweenedObject is responsible for
            if (!Obj.Equals(tweenShark.Obj))
            {
                return;
            }

            var runningTweenShark = new RunningTweenShark(tweenShark);

            foreach (var propertyOps in tweenShark.TweenOps.PropertyOpses)
            {
                // if there is no easing set on the single property we us the easing of the whole tween
                if (propertyOps.EaseFunc == null && propertyOps.EaseExFunc == null)
                {
                    if (tweenShark.TweenOps.EaseFunc != null)
                    {
                        propertyOps.Ease(tweenShark.TweenOps.EaseFunc);
                    }
                    else
                    {
                        propertyOps.EaseEx(tweenShark.TweenOps.EaseExFunc, tweenShark.TweenOps.EaseExParams);
                    }
                }

                var tweener = CreateTweener(propertyOps);

                // could we create the tweener or did already have one?
                if (tweener != null)
                {
                    // setup the tweener
                    tweener.Create(Obj, propertyOps);

                    // get the full property name including sub name
                    var fullPropertyName = tweener.GetFullPropertyName();

                    // add the tweener to the internal cache list of property tweeners

                    // TODO: overwrite handling
                    // if we nned to override go through all RunningTweenSharks
                    // TODO: check if there allready exists a tweener for this property
                    _propertyTweens[fullPropertyName] = tweener;

                    runningTweenShark.Add(tweener);
                }
            }

            _tweens.Add(runningTweenShark);
            tweenShark.RunningTweenShark = runningTweenShark;
        }
Ejemplo n.º 3
0
 public static void InitializeUnity(TweenSharkUnity3DTick behaviour)
 {
     TweenShark.Initialize(new TweenSharkTick(behaviour), new UnityLogger());
     TweenShark.RegisterPropertyTweener(typeof(UnityVector3Tweener), typeof(Vector3));
 }