public class CubeLogic : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetMouseButtonDown(0))
{
var position = gameObject.transform.position;
var pos = Camera.main.WorldToScreenPoint(position);
Debug.Log("** 屏幕宽度:" + Screen.width);
Debug.Log("** 屏幕高度:" + Screen.height);
Debug.Log("** 屏幕坐标:" + pos);
var mousePositon = Input.mousePosition;
Debug.Log("** 点击坐标:" + mousePositon);
}
gameObject.transform.Translate(1 * Time.deltaTime, 0, 0);
}
}