Unity绕某物体旋转

2019-07-19  本文已影响0人  沉麟

绕p点,y轴,旋转60度。

         IEnumerator IRota()
    {
        yield return null;
        int timer = 60;
        
        while (timer > 0)
        {
            yield return null;
            transform.RotateAround(p, new Vector3(0, -1, 0), 1.0f);//绕着某个点,绕着哪个轴,每帧转多少度
            timer -= 1;
        }
        yield return null;
       
    }
上一篇 下一篇

猜你喜欢

热点阅读