翻译所有的注释
This commit is contained in:
@@ -15,8 +15,8 @@ using UnityEngine.InputSystem;
|
||||
|
||||
namespace Kirurobo {
|
||||
/// <summary>
|
||||
/// Input System と Input Manager の違いを吸収するためのプロキシ
|
||||
/// </summary>
|
||||
/// 用于消除 Input System 和 Input Manager 差异的代理
|
||||
/// </summary>
|
||||
public class InputProxy
|
||||
{
|
||||
public static Vector3 mousePosition {
|
||||
@@ -26,7 +26,7 @@ namespace Kirurobo {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Input System の利用に合わせてキーアップを取得
|
||||
/// 配合 Input System 获取按键抬起
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool GetKeyUp(String key)
|
||||
@@ -34,22 +34,22 @@ namespace Kirurobo {
|
||||
#if ENABLE_LEGACY_INPUT_MANAGER
|
||||
return Input.GetKeyUp(key);
|
||||
#elif ENABLE_INPUT_SYSTEM
|
||||
// 簡易的な実装。keyが1文字で、かつアルファベットか数字に対応
|
||||
// 1文字以外は escape, space のみ対応
|
||||
// 简易实现。仅支持单字母字符或数字
|
||||
// 非单字符的仅支持 escape, space
|
||||
if (key.Length == 1) {
|
||||
Key k = Key.None;
|
||||
char c = key[0];
|
||||
if (c >= '0' && c <= '9') {
|
||||
// 数字の場合はDigit0~Digit9とNumpad0~Numpad9の両方に反応
|
||||
// 数字时同时响应 Digit0~Digit9 和 Numpad0~Numpad9
|
||||
k = (Key)Enum.ToObject(typeof(Key), (int)Key.Numpad0 + (int)(c - '0'));
|
||||
if (Keyboard.current[k].wasReleasedThisFrame) return true;
|
||||
|
||||
// Digitの場合はDigit0の値が最大
|
||||
// Digit 键中 Digit0 的数值最大
|
||||
k = (Key)Enum.ToObject(typeof(Key), (int)Key.Digit1 + (int)((c == '0' ? 9 : c - '1')));
|
||||
if (Keyboard.current[k].wasReleasedThisFrame) return true;
|
||||
}
|
||||
if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) {
|
||||
// アルファベットの場合は大文字・小文字どちらでも可とする
|
||||
// 字母时大小写均可
|
||||
k = (Key)Enum.ToObject(typeof(Key), (int)Key.A + (int)(Char.ToUpper(c) - 'A'));
|
||||
if (Keyboard.current[k].wasReleasedThisFrame) return true;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ namespace Kirurobo {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Input System の利用に合わせてマウス座標を取得
|
||||
/// 配合 Input System 获取鼠标坐标
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static Vector3 GetMousePosition()
|
||||
@@ -99,7 +99,7 @@ namespace Kirurobo {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// このフレームでマウスボタンが押されたか判定
|
||||
/// 判断本帧是否按下了鼠标按钮
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
Reference in New Issue
Block a user