Beispiel #1
0
        public Task shake()
        {
            TweenTask tt = new TweenTask(delegate {
                Tween tween = TweenShake.Begin(this.gameObject, 0.3f, Quaternion.Euler(new Vector3(10, 0, 0)));
                return(tween);
            });

            return(tt);
        }
Beispiel #2
0
        /// <summary>
        /// Start the tweening operation.
        /// </summary>

        static public TweenShake Begin(GameObject go, float duration, Quaternion rot)
        {
            TweenShake comp = Tween.Begin <TweenShake>(go, duration);

            comp.from = comp.rotation.eulerAngles;
            comp.to   = rot.eulerAngles;

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