1
This commit is contained in:
@@ -11,26 +11,30 @@ using MuHua;
|
||||
public class ModuleInput : ModuleSingle<ModuleInput> {
|
||||
|
||||
/// <summary> 当前输入模式 </summary>
|
||||
public static EnumInputMode inputMode;
|
||||
public static InputMode Current;
|
||||
/// <summary> 回退输入模式 </summary>
|
||||
public static InputMode BackMode;
|
||||
/// <summary> 鼠标指针位置 </summary>
|
||||
public static Vector3 mousePosition;
|
||||
public static Vector2 mousePosition;
|
||||
/// <summary> 转换模式事件 </summary>
|
||||
public static event Action<EnumInputMode> OnInputMode;
|
||||
/// <summary> 临时禁用事件 </summary>
|
||||
public static event Action<bool> OnTemporarilyDisable;
|
||||
|
||||
private static bool isPointerOverUIObject;// 指针是否在UI上
|
||||
public static event Action<InputMode> OnInputMode;
|
||||
|
||||
/// <summary> 指针是否在UI上 </summary>
|
||||
private static bool isPointerOverUIObject;
|
||||
/// <summary> 指针是否在UI上 </summary>
|
||||
public static bool IsPointerOverUIObject => isPointerOverUIObject;
|
||||
|
||||
/// <summary> 设置输入模式 </summary>
|
||||
public static void Mode(EnumInputMode mode) {
|
||||
inputMode = mode;
|
||||
OnInputMode?.Invoke(mode);
|
||||
public static void Settings(InputMode mode) {
|
||||
BackMode = Current;
|
||||
Current = mode;
|
||||
OnInputMode?.Invoke(Current);
|
||||
}
|
||||
/// <summary> 设置输入模式 </summary>
|
||||
public static void Back() {
|
||||
Current = BackMode;
|
||||
OnInputMode?.Invoke(Current);
|
||||
}
|
||||
/// <summary> 临时禁用输入 </summary>
|
||||
public static void TemporarilyDisable(bool value) => OnTemporarilyDisable?.Invoke(value);
|
||||
|
||||
protected override void Awake() => NoReplace();
|
||||
|
||||
@@ -50,3 +54,17 @@ public class ModuleInput : ModuleSingle<ModuleInput> {
|
||||
#endif
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 输入模式
|
||||
/// </summary>
|
||||
public enum InputMode {
|
||||
None,// 无
|
||||
|
||||
// FixedEdit,// 固定编辑
|
||||
|
||||
// FixedPreview,// 固定编辑
|
||||
|
||||
// FreeEdit,// 自由编辑
|
||||
|
||||
Standard,// 第三人称
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user