unity 中的鼠标事件



unity中的鼠标事件,可以通过  Input,GetMouse* 来获得, 0,为左键 , 1 为右键, 2为中键







    if(Input.GetMouseButtonDown(0))
        {
            Debug.Log("鼠标左键被按下!");
        }
        if(Input.GetMouseButtonDown(1))
        {
            Debug.Log("鼠标y右键被按下!");
        }
        if(Input.GetMouseButtonDown(2))
        {
            Debug.Log("鼠标中间");
        }


猜你喜欢

转载自blog.csdn.net/u014660247/article/details/71310388