美文网首页
Unity绕某物体旋转

Unity绕某物体旋转

作者: 沉麟 | 来源:发表于2019-07-19 11:49 被阅读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;
       
    }

相关文章

网友评论

      本文标题:Unity绕某物体旋转

      本文链接:https://www.haomeiwen.com/subject/egyjlctx.html