public void KeyInputEvent(EVMC4U.KeyInput key) { switch (key.active) { case 1: Debug.Log("" + key.name + "(" + key.keycode + ") pressed."); break; case 0: Debug.Log("" + key.name + "(" + key.keycode + ") released."); break; default: Debug.Log("" + key.name + "(" + key.keycode + ") unknown."); break; } }
public void KeyInputEvent(EVMC4U.KeyInput key) { if (key.active == 1) { switch (key.name) { case "W": direction = EDirection.FORWARD; break; case "S": direction = EDirection.BACK; break; case "A": direction = EDirection.LEFT; break; case "D": direction = EDirection.RIGHT; break; } } else { direction = 0; } }
public void KeyInputEvent(EVMC4U.KeyInput key) { if (!StickyMode) { //Zキーが押されたか if (key.name == LeftKey) { //つかみ・離し CatchLeft(key.active == 1); } //Xキー押されたか if (key.name == RightKey) { //つかみ・離し CatchRight(key.active == 1); } } else { if (key.active == 1) { //Zキーが押されたか if (key.name == LeftKey) { //つかみ・離し stickyLeft = !stickyLeft; CatchLeft(stickyLeft); } //Xキー押されたか if (key.name == RightKey) { //つかみ・離し stickyRight = !stickyRight; CatchRight(stickyRight); } } } }