首页 > 代码库 > unity jiaoben

unity jiaoben

transform.Translate(Input.GetAxis("Horizontal")*Time.deltaTime,0,0); 移动
transform.Translate(0,Input.GetAxis("Vertical") * Time.deltaTime, 0);

 

Instantiate(paodan_bl, transform.position, transform.rotation);实例化泡弹

Destroy(gameObject,1f);1秒后销毁携带脚本的物体

if (Input.GetKey("w"))
{
transform.Translate(Vector3.forward * Time.deltaTime * speed);

}
if (Input.GetKey("s"))
{
transform.Translate(Vector3.back * Time.deltaTime * speed);
}
if (Input.GetKey("a"))
{
transform.Translate(Vector3.left * Time.deltaTime * speed);
}
if (Input.GetKey("d"))
{
transform.Translate(Vector3.right * Time.deltaTime * speed);
}

 

unity jiaoben