📜  unity 如何加力 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:48.939000             🧑  作者: Mango

代码示例2
private Rigidbody2D rb;
public Vector2 direction;
public float force;

void Start()
{
    rb = GetComponent();
    rb.AddForce(direction * force, ForceMode2D.Impulse);
    //rb.AddForce(--pass in Vector--, --can pass in ForceMode--);
}