码迷,mamicode.com
首页 > 其他好文 > 详细

Transform 位置 旋转

时间:2016-11-24 19:06:42      阅读:132      评论:0      收藏:0      [点我收藏+]

标签:for   blog   sys   game   color   euler   body   orm   code   

using UnityEngine;
using System.Collections;
using Box2D.Dynamics;

public class BodyGameObj : MonoBehaviour {
    public b2Body body;

    void Start () {
    
    }

    void Update () {
        Vector3 pos = transform.localPosition;
        pos.x = body.GetPosition ().x;
        pos.y = body.GetPosition ().y;
        transform.localPosition = pos;
        transform.localRotation = Quaternion.Euler(0, 0, body.GetAngle () * 57.3f);
    }
}

 

Transform 位置 旋转

标签:for   blog   sys   game   color   euler   body   orm   code   

原文地址:http://www.cnblogs.com/kingBook/p/6098441.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!