unity 添加刚体力
using UnityEngine; using System.Collections; public class addFore : MonoBehaviour { private GameObject box; // Use this for initialization void Start () { box = GameObject.Find ("1"); } // Update is called once per frame void Update () { } void FixedUpdate() { box.GetComponent<Rigidbody2D>().AddForce(new Vector2(0f, 10f)); } }