public class TransformTarget : MonoBehaviour
{
public Transform Target;
public float roundSpeed = 1000.0f;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
this.transform.LookAt(Target);
if(Input.GetMouseButtonDown(1))
{
this.transform.RotateAround(Target.position, Vector3.up, roundSpeed * Time.deltaTime);
}
}
}
Target代表的事被环绕物体的东西,主要函数是RotateAround这个函数