https://docs.unity3d.com/ScriptReference/EventSystems.IPointerClickHandler.html
适用UI元素,非UI,camera添加PhysicsRaycaster;
Interface to implement if you wish to receive OnPointerClick callbacks.
Use the IPointerClickHandler Interface to handle click input using OnPointerClick callbacks. Ensure an Event System exists in the Scene to allow click detection. For click detection on non-UI GameObjects, ensure a PhysicsRaycaster is attached to the Camera.