标签:for start com https input href put col 必须
吃到金币
public class SphereMove : MonoBehaviour
{
public float Spheremove = 20;
public float Spherejump = 50;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetKey(KeyCode.UpArrow))
{
GetComponent<Rigidbody>().AddForce(Spheremove, 0, 0);
}
if (Input.GetKey(KeyCode.DownArrow))
{
GetComponent<Rigidbody>().AddForce(-Spheremove, 0, 0);
}
if (Input.GetKey(KeyCode.LeftArrow))
{
GetComponent<Rigidbody>().AddForce(0, 0, Spheremove);
}
if (Input.GetKey(KeyCode.RightArrow))
{
GetComponent<Rigidbody>().AddForce(0, 0, -Spheremove);
}
if (Input.GetKey(KeyCode.Space))
{
GetComponent<Rigidbody>().AddForce(0, Spherejump, 0);
}
}
public void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == ("Goodup"))
{
other.gameObject.SetActive(false);
}
}
}
public class Pickupsctrl : MonoBehaviour
{
public Vector3 rot;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
rot = new Vector3(0, 20, 0);
rot = rot* Time.deltaTime;
transform.Rotate(rot);
}
}
public class Canearctrl : MonoBehaviour
{
public Vector3 Offset;
public Transform player;
// Start is called before the first frame update
void Start()
{
Offset = this.transform.position - player.position;
}
// Update is called once per frame
void Update()
{
this.transform.position = player.position + Offset;
}
}
标签:for start com https input href put col 必须
原文地址:https://www.cnblogs.com/raymondking123/p/11404018.html