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); } }
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); } }