Esempio n. 1
0
        private void DelayRotate(Vec3 vec, int time = 0)
        {
            var t = time != -1 ? time : mDefaultTime;
            var d = vec.Convert() - transform.localEulerAngles;
            var v = new Vector3(d.x / t, d.y / t, d.z / t);

            MultiTask.Push((obj) =>
            {
                t--;
                if (t == 0)
                {
                    return(MultiTask.End.TRUE);
                }
                transform.Rotate(v);
                return(MultiTask.End.FALSE);
            });
        }
Esempio n. 2
0
        private void DelayMove(Vec3 vec, int time = -1)
        {
            var t = time != -1 ? time : mDefaultTime;
            var d = vec.Convert() - transform.localPosition;
            var v = new Vector3(d.x / t, d.y / t, d.z / t);

            MultiTask.Push((obj) =>
            {
                t--;
                if (t == 0)
                {
                    return(MultiTask.End.TRUE);
                }
                var loc = transform.localPosition;
                transform.localPosition = loc + v;
                return(MultiTask.End.FALSE);
            });
        }