Unity在编辑面板展示自定义的类
发布时间
阅读量:
阅读量
public class Boundary
{
public float xMin, xMax, zMin, zMax;
}
public class PlayerController : MonoBehaviour
{
public float speed;
public Boundary boundary;
private void FixedUpdate()
{
float moveHorizontal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
Rigidbody rigidbody = GetComponent<Rigidbody>();
rigidbody.velocity = movement * speed;
ri
全部评论 (0)
还没有任何评论哟~
