using UnityEngine;
using System.Collections;
public class Scrwww : MonoBehaviour
{
private float h;
private float v;
public Vector3 Torque;
// public Vector3 Torque=new Vector3();
private void FixedUpdate()
{
rigidbody.AddTorque(Torque*1);
}
private void Update()
{
if (Input.GetMouseButton(0))
{
h = Input.GetAxis("Mouse X"); //有正左负
v = Input.GetAxis("Mouse Y"); //上正下负
}
else
{
h = 0;
v = 0;
}
Torque =new Vector3(v*10, -h*10, 0);
if (Input.GetKey(KeyCode.Escape))
{
Application.Quit();
}
}
}
时间: 2024-10-12 18:52:38