コード例 #1
0
ファイル: CameraShake.cs プロジェクト: neolyster/Zombie
        private Task move(Tween.Method method, Vector3 to, float time)
        {
            TweenTask tt = new TweenTask(delegate {
                Tween tween  = TweenLocalPosition.Begin(this.gameObject, time, to);
                tween.method = method;
                return(tween);
            });

            return(tt);
        }
コード例 #2
0
        /// <summary>
        /// Start the tweening operation.
        /// </summary>

        static public TweenLocalPosition Begin(GameObject go, float duration, Vector3 pos)
        {
            TweenLocalPosition comp = Tween.Begin <TweenLocalPosition>(go, duration);

            comp.from = comp.position;
            comp.to   = pos;

            if (duration <= 0f)
            {
                comp.sample(1f, true);
                comp.enabled = false;
            }
            return(comp);
        }