unity 添加速度

using UnityEngine;
using System.Collections;

public class Flipped : MonoBehaviour {

    // Update is called once per frame
    void Update () {

        Rigidbody2D rigid = gameObject.GetComponent<Rigidbody2D> ();
        rigid.velocity = new Vector2 (1, 0);

    }
}

 

posted @ 2015-03-20 22:32  yufenghou  阅读(876)  评论(0编辑  收藏  举报