unity:将UI按钮添加到输入管理器

时间:2018-01-13 22:58:56

标签: c# unity3d

我正在开发一款Android游戏,其中主玩家使用2个ui操纵杆按钮进行控制。当鼠标X被指定为左键时,在触摸屏幕时(或在显影时按下鼠标)点击播放器统计数据。那么如何编辑以下代码或将左键单击更改为ui按钮。

玩家投篮输入

if ((CrossPlatformInputManager.GetAxisRaw("Mouse X") != 0 || CrossPlatformInputManager.GetAxisRaw("Mouse Y") != 0) && timer >= timeBetweenBullets)
        {
            // ... shoot the gun
            Shoot();
        }

0 个答案:

没有答案
相关问题