コード例 #1
0
ファイル: Tweener.cs プロジェクト: k-may/LightTween
        public void addTween(object o, string property_name, float startVal, float endVal, int duration, TransitionType transitionType = null)
        {
            if (transitionType == null)
                transitionType = TransitionType.LINEAR;

            this.addTween(o, property_name, startVal, endVal, duration, transitionType, null, null);
        }
コード例 #2
0
ファイル: Tweener.cs プロジェクト: k-may/LightTween
 public void addTween(object o, string property_name, float startVal, float endVal, int duration, TransitionType transitionType, AnimationComplete _completeHandler = null, AnimationUpdate _updateHandler = null)
 {
     TweenData tween = new TweenData(o, property_name, startVal, endVal, duration, transitionType, _completeHandler, _updateHandler);
     this.addTween(tween);
 }
コード例 #3
0
ファイル: Tweener.cs プロジェクト: k-may/LightTween
 public TweenData(object o, string property_name, float startVal, float endVal, int duration, TransitionType transitionType)
 {
     this._object = o;
     this._prop = _object.GetType().GetProperty(property_name);
     _startVal = startVal;
     _endVal = endVal == -1 ? float.Parse(_prop.GetValue(_object, null).ToString()) : endVal;
     _duration = duration;
     _property_name = property_name;
     _tweenFunc = Tweener.GetFunction(transitionType);
 }
コード例 #4
0
ファイル: Tweener.cs プロジェクト: k-may/LightTween
        public static TweeningFunction GetFunction(TransitionType type)
        {
            TweeningFunction tweenFunc;

            switch (type.ToString())
            {
                case "easeIn":
                    tweenFunc = TweenHelper.EaseIn;
                    break;
                case "easeOut":
                    tweenFunc = TweenHelper.EaseOut;
                    break;
                case "easeInOut":
                    tweenFunc = TweenHelper.EaseInOut;
                    break;
                case "linear":
                    tweenFunc = TweenHelper.Linear;
                    break;
                case "easeOutCubic":
                    tweenFunc = TweenHelper.EaseOutCubic;
                    break;
                case "easeInOutQuad":
                default:
                    tweenFunc = TweenHelper.EaseInOutQuad;
                    break;
            }
            return tweenFunc;
        }
コード例 #5
0
ファイル: Tweener.cs プロジェクト: k-may/LightTween
 public TweenData(object o, string property_name, float startVal, float endVal, int duration, TransitionType transitionType, AnimationComplete _completeHandler, AnimationUpdate _updateHandler)
     : this(o, property_name, startVal, endVal, duration, transitionType)
 {
     Complete += _completeHandler;
     Update += _updateHandler;
 }