input相关
This commit is contained in:
@@ -459,7 +459,7 @@
|
||||
"id": "c1f7a91b-d0fd-4a62-997e-7fb9b69bf235",
|
||||
"path": "<Gamepad>/rightStick",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"processors": "ScaleVector2(x=40,y=40)",
|
||||
"groups": ";Gamepad",
|
||||
"action": "Look",
|
||||
"isComposite": false,
|
||||
@@ -978,7 +978,7 @@
|
||||
"id": "348bd961-a6a0-4d13-b414-83b43201bc10",
|
||||
"expectedControlType": "",
|
||||
"processors": "",
|
||||
"interactions": "",
|
||||
"interactions": "Hold",
|
||||
"initialStateCheck": false
|
||||
},
|
||||
{
|
||||
@@ -987,7 +987,7 @@
|
||||
"id": "da1344ed-a4b5-43ef-bad6-a3f6bb06ff23",
|
||||
"expectedControlType": "",
|
||||
"processors": "",
|
||||
"interactions": "",
|
||||
"interactions": "Hold",
|
||||
"initialStateCheck": false
|
||||
},
|
||||
{
|
||||
@@ -996,7 +996,7 @@
|
||||
"id": "dafd152b-aa0a-48bb-890d-289ab3a3e713",
|
||||
"expectedControlType": "",
|
||||
"processors": "",
|
||||
"interactions": "",
|
||||
"interactions": "Hold",
|
||||
"initialStateCheck": false
|
||||
},
|
||||
{
|
||||
@@ -1005,7 +1005,7 @@
|
||||
"id": "e0dbeebd-c69d-44bd-83de-94fcce8c6727",
|
||||
"expectedControlType": "",
|
||||
"processors": "",
|
||||
"interactions": "",
|
||||
"interactions": "Hold",
|
||||
"initialStateCheck": false
|
||||
},
|
||||
{
|
||||
@@ -1041,6 +1041,28 @@
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "e834d5a6-95f1-4142-9da6-4cbcc8618342",
|
||||
"path": "<XInputController>/buttonEast",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "Back",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "48a10b34-e3b4-4a90-98a2-95e128a3417a",
|
||||
"path": "<Gamepad>/buttonEast",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "Back",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "a6e94404-e896-4fec-b3bf-affd31b12571",
|
||||
@@ -1052,6 +1074,17 @@
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "7028032c-6c7f-4846-8d2c-a41c3c2822fd",
|
||||
"path": "<XInputController>/buttonEast",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "Enter",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "23dac47b-935f-4261-8044-a8612edf3fda",
|
||||
@@ -1074,6 +1107,28 @@
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "5e809757-a6a4-4f89-9256-619af1216748",
|
||||
"path": "<XInputController>/leftShoulder",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "Prev",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "5a43b881-410f-4e67-913f-cbc379ae6953",
|
||||
"path": "<Gamepad>/leftShoulder",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "Prev",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "2661bf5d-0afe-4f8c-a4e8-2aa6150c724d",
|
||||
@@ -1085,6 +1140,28 @@
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "7250c0b2-9b1c-445e-8c8e-125dcf79e29f",
|
||||
"path": "<XInputController>/rightShoulder",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "Next",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "9fa9e49d-5262-4890-8ba2-6c84695f88aa",
|
||||
"path": "<Gamepad>/rightShoulder",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "Next",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "487ceb23-336d-45f6-a782-3b4e9d9f0cd1",
|
||||
@@ -1096,6 +1173,28 @@
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "589ddbb5-aedc-483d-957c-1fd7c1a12002",
|
||||
"path": "<XInputController>/leftTrigger",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "SubPrev",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "0fe51227-7d8b-4baa-9d25-8396deefc34d",
|
||||
"path": "<Gamepad>/leftTrigger",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "SubPrev",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "463ec073-6e9d-4b1d-9956-8ec19838aa3e",
|
||||
@@ -1107,6 +1206,28 @@
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "2c584e41-80cd-463e-8423-ac74c932c90b",
|
||||
"path": "<XInputController>/rightTrigger",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "SubNext",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "c8394c43-028f-4056-b5bd-f81395997f15",
|
||||
"path": "<Gamepad>/rightTrigger",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "SubNext",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "053ddbac-9f73-4672-be59-abfdb6037aea",
|
||||
@@ -1118,6 +1239,17 @@
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "2e150513-8adf-4e87-b5c9-cab09870835e",
|
||||
"path": "<Gamepad>/leftStick/right",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "Right",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "031b930d-59b6-4a26-9dfe-97764c3e8b37",
|
||||
@@ -1129,6 +1261,17 @@
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "dced9424-e4e1-40d9-8aea-b69491365e74",
|
||||
"path": "<Gamepad>/leftStick/left",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "Left",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "45f78626-cbf2-4e1f-904d-d82e4c2a2f41",
|
||||
@@ -1140,6 +1283,17 @@
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "2e119597-8f21-4c82-916c-57ffcd0f34c5",
|
||||
"path": "<Gamepad>/leftStick/down",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "Down",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "f1a47b3c-e79f-4ab3-86b6-fcc0a6470114",
|
||||
@@ -1151,6 +1305,17 @@
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "9a43ed61-260a-4f92-9e49-3df421db4051",
|
||||
"path": "<Gamepad>/leftStick/up",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "Up",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "393f1eb9-d10d-4cd1-87e7-ea299f92b2da",
|
||||
|
||||
@@ -713,17 +713,17 @@ MonoBehaviour:
|
||||
obiRopeSegment_1: {fileID: 114755058551407608}
|
||||
obiRopeSegment_2: {fileID: 114352801149539185}
|
||||
obiRopeSegment_3: {fileID: 0}
|
||||
LineConnector_0: {fileID: 138430089226111772}
|
||||
LineConnector_0: {fileID: 1161489717910266977}
|
||||
LineConnector_1: {fileID: 145801244473724727}
|
||||
LineConnector_2: {fileID: 145615548544929331}
|
||||
LineConnector_3: {fileID: 0}
|
||||
currentRodFishingLineComponent: {fileID: 0}
|
||||
toRodConnector: {fileID: 114110690660507634}
|
||||
ObiLineOut: 0
|
||||
EndLineRigidbody_0: {fileID: 0}
|
||||
EndLineRigidbody_1: {fileID: 0}
|
||||
EndLineRigidbody_2: {fileID: 0}
|
||||
EndLineRigidbody_3: {fileID: 0}
|
||||
pinchController: {fileID: 0}
|
||||
Rod: {fileID: 0}
|
||||
--- !u!1 &1399535376626843
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -860,11 +860,10 @@ SpringJoint:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1399535376626843}
|
||||
serializedVersion: 3
|
||||
serializedVersion: 4
|
||||
m_ConnectedBody: {fileID: 54033698817467605}
|
||||
m_ConnectedArticulationBody: {fileID: 0}
|
||||
m_Anchor: {x: 0, y: 0, z: 0}
|
||||
m_Axis: {x: 1, y: 0, z: 0}
|
||||
m_AutoConfigureConnectedAnchor: 0
|
||||
m_ConnectedAnchor: {x: 0, y: 0, z: 0}
|
||||
m_Spring: 2500
|
||||
@@ -891,7 +890,7 @@ GameObject:
|
||||
- component: {fileID: 23864529173902638}
|
||||
- component: {fileID: 54033698817467605}
|
||||
- component: {fileID: 114898669112954178}
|
||||
- component: {fileID: 138430089226111772}
|
||||
- component: {fileID: 1161489717910266977}
|
||||
m_Layer: 10
|
||||
m_Name: LineConnector_0
|
||||
m_TagString: Untagged
|
||||
@@ -1007,22 +1006,19 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
kinematicForParticles: 1
|
||||
--- !u!138 &138430089226111772
|
||||
FixedJoint:
|
||||
--- !u!114 &1161489717910266977
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1584826894208304}
|
||||
serializedVersion: 1
|
||||
m_ConnectedBody: {fileID: 0}
|
||||
m_ConnectedArticulationBody: {fileID: 0}
|
||||
m_BreakForce: Infinity
|
||||
m_BreakTorque: Infinity
|
||||
m_EnableCollision: 0
|
||||
m_EnablePreprocessing: 1
|
||||
m_MassScale: 1
|
||||
m_ConnectedMassScale: 1
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 112f7ad42d8149c1944bb51067ef1966, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
target: {fileID: 0}
|
||||
--- !u!1 &1777911290578827
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1159,11 +1155,10 @@ SpringJoint:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1777911290578827}
|
||||
serializedVersion: 3
|
||||
serializedVersion: 4
|
||||
m_ConnectedBody: {fileID: 54633220251865601}
|
||||
m_ConnectedArticulationBody: {fileID: 0}
|
||||
m_Anchor: {x: 0, y: 0, z: 0}
|
||||
m_Axis: {x: 1, y: 0, z: 0}
|
||||
m_AutoConfigureConnectedAnchor: 0
|
||||
m_ConnectedAnchor: {x: 0, y: 0, z: 0}
|
||||
m_Spring: 2000
|
||||
|
||||
3
Assets/Scripts/Common/Attrobites.meta
Normal file
3
Assets/Scripts/Common/Attrobites.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7cb50811095d496fad57afd7535d0f73
|
||||
timeCreated: 1748180763
|
||||
66
Assets/Scripts/Common/Attrobites/AttributeHelper.cs
Normal file
66
Assets/Scripts/Common/Attrobites/AttributeHelper.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public static class AttributeHelper
|
||||
{
|
||||
// 获取特定嵌套类中带有InputIconAttribute的常量字段
|
||||
public static Dictionary<string, List<FieldInfo>> GetNestedClassInputIconFields()
|
||||
{
|
||||
var result = new Dictionary<string, List<FieldInfo>>();
|
||||
|
||||
// 获取InputDef类型
|
||||
Type inputDefType = typeof(NBF.InputDef);
|
||||
|
||||
// 检查UI类
|
||||
Type uiType = inputDefType.GetNestedType("UI");
|
||||
if (uiType != null)
|
||||
{
|
||||
var uiFields = GetInputIconFieldsFromType(uiType);
|
||||
if (uiFields.Count > 0)
|
||||
{
|
||||
result.Add("UI", uiFields);
|
||||
}
|
||||
}
|
||||
|
||||
// 检查Player类
|
||||
Type playerType = inputDefType.GetNestedType("Player");
|
||||
if (playerType != null)
|
||||
{
|
||||
var playerFields = GetInputIconFieldsFromType(playerType);
|
||||
if (playerFields.Count > 0)
|
||||
{
|
||||
result.Add("Player", playerFields);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// 从特定类型获取带有InputIconAttribute的常量字段
|
||||
private static List<FieldInfo> GetInputIconFieldsFromType(Type type)
|
||||
{
|
||||
List<FieldInfo> result = new List<FieldInfo>();
|
||||
|
||||
// 只获取公共常量字段
|
||||
FieldInfo[] fields = type.GetFields(
|
||||
BindingFlags.Public |
|
||||
BindingFlags.Static |
|
||||
BindingFlags.FlattenHierarchy);
|
||||
|
||||
foreach (FieldInfo field in fields)
|
||||
{
|
||||
// 检查是否是常量且带有InputIconAttribute
|
||||
if (field.IsLiteral && !field.IsInitOnly &&
|
||||
Attribute.IsDefined(field, typeof(InputIconAttribute)))
|
||||
{
|
||||
result.Add(field);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Common/Attrobites/AttributeHelper.cs.meta
Normal file
3
Assets/Scripts/Common/Attrobites/AttributeHelper.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fa024ae7ea104f809ace6beff59c12d8
|
||||
timeCreated: 1748188551
|
||||
22
Assets/Scripts/Common/Attrobites/InputIconAttribute.cs
Normal file
22
Assets/Scripts/Common/Attrobites/InputIconAttribute.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
public class InputIconAttribute : Attribute
|
||||
{
|
||||
public string KeyBoardIcon;
|
||||
public string ControllerIcon;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="keyBoardIcon">键盘图标</param>
|
||||
/// <param name="controllerIcon">控制器图标</param>
|
||||
public InputIconAttribute(string keyBoardIcon, string controllerIcon)
|
||||
{
|
||||
KeyBoardIcon = keyBoardIcon;
|
||||
ControllerIcon = controllerIcon;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5fb17097160c43ee9840411aded17084
|
||||
timeCreated: 1748180773
|
||||
3
Assets/Scripts/Common/Input.meta
Normal file
3
Assets/Scripts/Common/Input.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d846463d130b4191a5a4a9d2e2dfe45b
|
||||
timeCreated: 1748180579
|
||||
46
Assets/Scripts/Common/Input/InputCursorExtension.cs
Normal file
46
Assets/Scripts/Common/Input/InputCursorExtension.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using NBC;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public static class InputCursorExtension
|
||||
{
|
||||
public static void InputInit()
|
||||
{
|
||||
UI.Inst.On(UIEvents.UIShow, UIShow, null, 1);
|
||||
UI.Inst.On(UIEvents.UIHide, UIHide, null, 1);
|
||||
}
|
||||
|
||||
public static void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
private static void UIShow(EventArgs ev)
|
||||
{
|
||||
CheckUICursor();
|
||||
}
|
||||
|
||||
private static void UIHide(EventArgs ev)
|
||||
{
|
||||
CheckUICursor();
|
||||
}
|
||||
|
||||
|
||||
private static void CheckUICursor()
|
||||
{
|
||||
var uis = UI.Inst.GetAllUI();
|
||||
bool showCursor = false;
|
||||
foreach (var ui in uis)
|
||||
{
|
||||
if (!ui.IsShowing) continue;
|
||||
if (ui.IsShowCursor)
|
||||
{
|
||||
showCursor = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
Log.Error($"showCursor={showCursor}");
|
||||
InputManager.IsUIStopInput = showCursor;
|
||||
InputManager.SetMouseCursor(showCursor);
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Common/Input/InputCursorExtension.cs.meta
Normal file
3
Assets/Scripts/Common/Input/InputCursorExtension.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0644b8eb12e44351ab75b467f90d4c32
|
||||
timeCreated: 1748185434
|
||||
@@ -7,6 +7,12 @@ using UnityEngine.InputSystem;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public enum ControllerType
|
||||
{
|
||||
KeyboardMouse = 0,
|
||||
GamePad = 1
|
||||
}
|
||||
|
||||
public class InputManager : MonoBehaviour
|
||||
{
|
||||
public static InputManager Instance { get; private set; }
|
||||
@@ -44,17 +50,62 @@ namespace NBF
|
||||
|
||||
public static PlayerInputControl PlayerInputControl { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手柄输入
|
||||
/// </summary>
|
||||
public static bool IsControllerInput;
|
||||
|
||||
/// <summary>
|
||||
/// ui阻止游戏输入
|
||||
/// </summary>
|
||||
public static bool IsUIStopInput;
|
||||
|
||||
public static ControllerType ControllerType = ControllerType.KeyboardMouse;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Instance = this;
|
||||
InputCursorExtension.InputInit();
|
||||
DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
PlayerInputControl = new PlayerInputControl();
|
||||
PlayerInputControl.Enable();
|
||||
AddEvent();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
RemoveEvent();
|
||||
InputCursorExtension.Dispose();
|
||||
}
|
||||
|
||||
|
||||
public static void SetMouseCursor(bool val)
|
||||
{
|
||||
if (val)
|
||||
{
|
||||
if (ControllerType == ControllerType.KeyboardMouse)
|
||||
{
|
||||
Cursor.visible = true;
|
||||
}
|
||||
|
||||
Cursor.lockState = CursorLockMode.None;
|
||||
}
|
||||
else if (ControllerType == ControllerType.KeyboardMouse)
|
||||
{
|
||||
Cursor.visible = false;
|
||||
}
|
||||
|
||||
Cursor.visible = val;
|
||||
if (!val)
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.Confined;
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector2 GetMovementInput()
|
||||
{
|
||||
if (IsUIStopInput) return Vector2.zero;
|
||||
@@ -67,17 +118,6 @@ namespace NBF
|
||||
return PlayerInputControl.Player.Look?.ReadValue<Vector2>() ?? Vector2.zero;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
PlayerInputControl = new PlayerInputControl();
|
||||
PlayerInputControl.Enable();
|
||||
AddEvent();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
RemoveEvent();
|
||||
}
|
||||
|
||||
private void AddEvent()
|
||||
{
|
||||
@@ -95,7 +135,7 @@ namespace NBF
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (actionMap.name == "Normal")
|
||||
else if (actionMap.name == "Player")
|
||||
{
|
||||
foreach (var action in actionMap.actions)
|
||||
{
|
||||
@@ -139,6 +179,8 @@ namespace NBF
|
||||
{
|
||||
OnOp2Action?.Invoke(true);
|
||||
}
|
||||
|
||||
OnPlayerPerformed?.Invoke(actionName);
|
||||
}
|
||||
|
||||
private void OnPlayerButtonCanceled(InputAction.CallbackContext context)
|
||||
@@ -153,6 +195,8 @@ namespace NBF
|
||||
{
|
||||
OnOp2Action?.Invoke(false);
|
||||
}
|
||||
|
||||
OnPlayerCanceled?.Invoke(actionName);
|
||||
}
|
||||
|
||||
|
||||
30
Assets/Scripts/Common/PermanentCommon.cs
Normal file
30
Assets/Scripts/Common/PermanentCommon.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using NBC;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
/// <summary>
|
||||
/// 常驻公共脚本
|
||||
/// </summary>
|
||||
public class PermanentCommon
|
||||
{
|
||||
private static bool _init;
|
||||
private static PermanentCommon _inst;
|
||||
|
||||
public static PermanentCommon Inst
|
||||
{
|
||||
get { return _inst ??= new PermanentCommon(); }
|
||||
}
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
if (_init) return;
|
||||
_init = true;
|
||||
}
|
||||
|
||||
public static void Dispose()
|
||||
{
|
||||
_init = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Common/PermanentCommon.cs.meta
Normal file
3
Assets/Scripts/Common/PermanentCommon.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3816467cfd1648e685a33ebfd1d9fb7d
|
||||
timeCreated: 1748184924
|
||||
@@ -1,27 +1,143 @@
|
||||
namespace NBF
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using NBC;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public class InputDef
|
||||
{
|
||||
public class UI
|
||||
{
|
||||
public static Dictionary<string, List<string>> Icons = new Dictionary<string, List<string>>();
|
||||
|
||||
[InputIcon("icon_controller_123", "icon_controller_2")]
|
||||
public const string Back = "Back";
|
||||
|
||||
[InputIcon("icon_controller_129", "icon_controller_1")]
|
||||
public const string Enter = "Enter";
|
||||
|
||||
[InputIcon("icon_controller_127", "icon_controller_19")]
|
||||
public const string Tab = "Tab";
|
||||
|
||||
[InputIcon("icon_controller_29", "icon_controller_89")]
|
||||
public const string Prev = "Prev";
|
||||
|
||||
[InputIcon("icon_controller_30", "icon_controller_77")]
|
||||
public const string Next = "Next";
|
||||
|
||||
[InputIcon("icon_controller_98", "icon_controller_27")]
|
||||
public const string SubPrev = "SubPrev";
|
||||
|
||||
[InputIcon("icon_controller_75", " icon_controller_28")]
|
||||
public const string SubNext = "SubNext";
|
||||
public const string Left = "Left";
|
||||
public const string Right = "Right";
|
||||
public const string Up = "Up";
|
||||
public const string Down = "Down";
|
||||
|
||||
[InputIcon("", "")] public const string Left = "Left";
|
||||
[InputIcon("", "")] public const string Right = "Right";
|
||||
[InputIcon("", "")] public const string Up = "Up";
|
||||
[InputIcon("", "")] public const string Down = "Down";
|
||||
}
|
||||
|
||||
public class Player
|
||||
public static class Player
|
||||
{
|
||||
public static Dictionary<string, List<string>> Icons = new Dictionary<string, List<string>>();
|
||||
public const string Run = "Run";
|
||||
public const string Use1 = "Use1";
|
||||
public const string Use2 = "Use2";
|
||||
}
|
||||
|
||||
#region Load Icon
|
||||
|
||||
public static void LoadIcon()
|
||||
{
|
||||
// 获取InputDef类型
|
||||
Type inputDefType = typeof(NBF.InputDef);
|
||||
|
||||
// 检查UI类
|
||||
Type uiType = inputDefType.GetNestedType("UI");
|
||||
if (uiType != null)
|
||||
{
|
||||
var uiFields = GetInputIconFieldsFromType(uiType);
|
||||
if (uiFields.Count > 0)
|
||||
{
|
||||
foreach (var field in uiFields)
|
||||
{
|
||||
InputIconAttribute attribute =
|
||||
(InputIconAttribute)Attribute.GetCustomAttribute(field, typeof(InputIconAttribute));
|
||||
|
||||
string value = (string)field.GetValue(null); // 获取常量值
|
||||
if (attribute != null)
|
||||
{
|
||||
List<string> icons = new List<string>
|
||||
{
|
||||
attribute.KeyBoardIcon,
|
||||
attribute.ControllerIcon
|
||||
};
|
||||
UI.Icons[value] = icons;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 检查Player类
|
||||
Type playerType = inputDefType.GetNestedType("Player");
|
||||
if (playerType != null)
|
||||
{
|
||||
var playerFields = GetInputIconFieldsFromType(playerType);
|
||||
if (playerFields.Count > 0)
|
||||
{
|
||||
foreach (var field in playerFields)
|
||||
{
|
||||
InputIconAttribute attribute =
|
||||
(InputIconAttribute)Attribute.GetCustomAttribute(field, typeof(InputIconAttribute));
|
||||
|
||||
string value = (string)field.GetValue(null); // 获取常量值
|
||||
if (attribute != null)
|
||||
{
|
||||
List<string> icons = new List<string>
|
||||
{
|
||||
attribute.KeyBoardIcon,
|
||||
attribute.ControllerIcon
|
||||
};
|
||||
Player.Icons[value] = icons;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// foreach (var key in InputDef.UI.Icons.Keys)
|
||||
// {
|
||||
// var icons = InputDef.UI.Icons[key];
|
||||
// Log.Error($"KEY={key} icon={string.Join(",", icons)}");
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
// 从特定类型获取带有InputIconAttribute的常量字段
|
||||
private static List<FieldInfo> GetInputIconFieldsFromType(Type type)
|
||||
{
|
||||
List<FieldInfo> result = new List<FieldInfo>();
|
||||
|
||||
// 只获取公共常量字段
|
||||
FieldInfo[] fields = type.GetFields(
|
||||
BindingFlags.Public |
|
||||
BindingFlags.Static |
|
||||
BindingFlags.FlattenHierarchy);
|
||||
|
||||
foreach (FieldInfo field in fields)
|
||||
{
|
||||
// 检查是否是常量且带有InputIconAttribute
|
||||
if (field.IsLiteral && !field.IsInitOnly &&
|
||||
Attribute.IsDefined(field, typeof(InputIconAttribute)))
|
||||
{
|
||||
result.Add(field);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -103,12 +103,12 @@ public class FHook : FPlayerGear
|
||||
|
||||
private void OnCollisionEnter(Collision collision)
|
||||
{
|
||||
if (!waterDisplacement.isInWater && (bool)Owner.Gears.Rod &&
|
||||
(bool)Owner.Gears.Rod.lineHandler && !Owner.Gears.Rod.currentFish &&
|
||||
Owner.Data.lineLength > 5f &&
|
||||
Vector3.Distance(transform.position, Owner.Gears.Rod.transform.position) > 5f)
|
||||
{
|
||||
// GameManager.Instance.ShowMessagePopup(LanguageManager.Instance.GetText("HOOK_ON_THE_GROUND"), FScriptsHandler.Instance.m_Canvas.transform, deleteLast: true);
|
||||
}
|
||||
// if (!waterDisplacement.isInWater && (bool)Owner.Gears.Rod &&
|
||||
// (bool)Owner.Gears.Rod.lineHandler && !Owner.Gears.Rod.currentFish &&
|
||||
// Owner.Data.lineLength > 5f &&
|
||||
// Vector3.Distance(transform.position, Owner.Gears.Rod.transform.position) > 5f)
|
||||
// {
|
||||
// GameManager.Instance.ShowMessagePopup(LanguageManager.Instance.GetText("HOOK_ON_THE_GROUND"), FScriptsHandler.Instance.m_Canvas.transform, deleteLast: true);
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ namespace NBF
|
||||
transform.position = _player.Data.position;
|
||||
transform.rotation = _player.Data.rotation;
|
||||
|
||||
App.Inst.SetMouseCurrsor(false);
|
||||
|
||||
InputManager.OnPlayerCanceled += OnPlayerCanceled;
|
||||
InputManager.OnPlayerPerformed += OnPlayerPerformed;
|
||||
// InputManager.OnRunAction += OnRunAction;
|
||||
@@ -192,7 +192,7 @@ namespace NBF
|
||||
{
|
||||
// Move
|
||||
Vector2 movementInput = InputManager.GetMovementInput();
|
||||
|
||||
|
||||
Vector3 movementDirection = Vector3.zero;
|
||||
|
||||
movementDirection += Vector3.forward * movementInput.y;
|
||||
|
||||
@@ -547,7 +547,7 @@ namespace NBF
|
||||
""id"": ""c1f7a91b-d0fd-4a62-997e-7fb9b69bf235"",
|
||||
""path"": ""<Gamepad>/rightStick"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""processors"": ""ScaleVector2(x=40,y=40)"",
|
||||
""groups"": "";Gamepad"",
|
||||
""action"": ""Look"",
|
||||
""isComposite"": false,
|
||||
@@ -1066,7 +1066,7 @@ namespace NBF
|
||||
""id"": ""348bd961-a6a0-4d13-b414-83b43201bc10"",
|
||||
""expectedControlType"": """",
|
||||
""processors"": """",
|
||||
""interactions"": """",
|
||||
""interactions"": ""Hold"",
|
||||
""initialStateCheck"": false
|
||||
},
|
||||
{
|
||||
@@ -1075,7 +1075,7 @@ namespace NBF
|
||||
""id"": ""da1344ed-a4b5-43ef-bad6-a3f6bb06ff23"",
|
||||
""expectedControlType"": """",
|
||||
""processors"": """",
|
||||
""interactions"": """",
|
||||
""interactions"": ""Hold"",
|
||||
""initialStateCheck"": false
|
||||
},
|
||||
{
|
||||
@@ -1084,7 +1084,7 @@ namespace NBF
|
||||
""id"": ""dafd152b-aa0a-48bb-890d-289ab3a3e713"",
|
||||
""expectedControlType"": """",
|
||||
""processors"": """",
|
||||
""interactions"": """",
|
||||
""interactions"": ""Hold"",
|
||||
""initialStateCheck"": false
|
||||
},
|
||||
{
|
||||
@@ -1093,7 +1093,7 @@ namespace NBF
|
||||
""id"": ""e0dbeebd-c69d-44bd-83de-94fcce8c6727"",
|
||||
""expectedControlType"": """",
|
||||
""processors"": """",
|
||||
""interactions"": """",
|
||||
""interactions"": ""Hold"",
|
||||
""initialStateCheck"": false
|
||||
},
|
||||
{
|
||||
@@ -1129,6 +1129,28 @@ namespace NBF
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""e834d5a6-95f1-4142-9da6-4cbcc8618342"",
|
||||
""path"": ""<XInputController>/buttonEast"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Back"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""48a10b34-e3b4-4a90-98a2-95e128a3417a"",
|
||||
""path"": ""<Gamepad>/buttonEast"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Back"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""a6e94404-e896-4fec-b3bf-affd31b12571"",
|
||||
@@ -1140,6 +1162,17 @@ namespace NBF
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""7028032c-6c7f-4846-8d2c-a41c3c2822fd"",
|
||||
""path"": ""<XInputController>/buttonEast"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Enter"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""23dac47b-935f-4261-8044-a8612edf3fda"",
|
||||
@@ -1162,6 +1195,28 @@ namespace NBF
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""5e809757-a6a4-4f89-9256-619af1216748"",
|
||||
""path"": ""<XInputController>/leftShoulder"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Prev"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""5a43b881-410f-4e67-913f-cbc379ae6953"",
|
||||
""path"": ""<Gamepad>/leftShoulder"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Prev"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""2661bf5d-0afe-4f8c-a4e8-2aa6150c724d"",
|
||||
@@ -1173,6 +1228,28 @@ namespace NBF
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""7250c0b2-9b1c-445e-8c8e-125dcf79e29f"",
|
||||
""path"": ""<XInputController>/rightShoulder"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Next"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""9fa9e49d-5262-4890-8ba2-6c84695f88aa"",
|
||||
""path"": ""<Gamepad>/rightShoulder"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Next"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""487ceb23-336d-45f6-a782-3b4e9d9f0cd1"",
|
||||
@@ -1184,6 +1261,28 @@ namespace NBF
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""589ddbb5-aedc-483d-957c-1fd7c1a12002"",
|
||||
""path"": ""<XInputController>/leftTrigger"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""SubPrev"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""0fe51227-7d8b-4baa-9d25-8396deefc34d"",
|
||||
""path"": ""<Gamepad>/leftTrigger"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""SubPrev"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""463ec073-6e9d-4b1d-9956-8ec19838aa3e"",
|
||||
@@ -1195,6 +1294,28 @@ namespace NBF
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""2c584e41-80cd-463e-8423-ac74c932c90b"",
|
||||
""path"": ""<XInputController>/rightTrigger"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""SubNext"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""c8394c43-028f-4056-b5bd-f81395997f15"",
|
||||
""path"": ""<Gamepad>/rightTrigger"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""SubNext"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""053ddbac-9f73-4672-be59-abfdb6037aea"",
|
||||
@@ -1206,6 +1327,17 @@ namespace NBF
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""2e150513-8adf-4e87-b5c9-cab09870835e"",
|
||||
""path"": ""<Gamepad>/leftStick/right"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Right"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""031b930d-59b6-4a26-9dfe-97764c3e8b37"",
|
||||
@@ -1217,6 +1349,17 @@ namespace NBF
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""dced9424-e4e1-40d9-8aea-b69491365e74"",
|
||||
""path"": ""<Gamepad>/leftStick/left"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Left"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""45f78626-cbf2-4e1f-904d-d82e4c2a2f41"",
|
||||
@@ -1228,6 +1371,17 @@ namespace NBF
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""2e119597-8f21-4c82-916c-57ffcd0f34c5"",
|
||||
""path"": ""<Gamepad>/leftStick/down"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Down"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""f1a47b3c-e79f-4ab3-86b6-fcc0a6470114"",
|
||||
@@ -1239,6 +1393,17 @@ namespace NBF
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""9a43ed61-260a-4f92-9e49-3df421db4051"",
|
||||
""path"": ""<Gamepad>/leftStick/up"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Up"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""393f1eb9-d10d-4cd1-87e7-ea299f92b2da"",
|
||||
|
||||
@@ -18,7 +18,9 @@ namespace NBC
|
||||
bool IsDotDel { get; }
|
||||
|
||||
bool IsModal { get; }
|
||||
|
||||
|
||||
bool IsShowCursor { get; }
|
||||
|
||||
void SetUIManager(UIManager kit);
|
||||
void SetData(object args);
|
||||
object GetData();
|
||||
|
||||
@@ -35,6 +35,11 @@ namespace NBC
|
||||
/// </summary>
|
||||
public virtual int Id { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否显示光标,屏蔽游戏内输入
|
||||
/// </summary>
|
||||
public virtual bool IsShowCursor { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// 面板打开动画
|
||||
/// </summary>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System.Collections;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using FairyGUI;
|
||||
using NBC;
|
||||
@@ -9,12 +11,6 @@ using UnityEngine.Video;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public enum ControllerType
|
||||
{
|
||||
KeyboardMouse = 0,
|
||||
GamePad = 1
|
||||
}
|
||||
|
||||
public class App : MonoBehaviour
|
||||
{
|
||||
public static App Inst { get; private set; }
|
||||
@@ -35,6 +31,11 @@ namespace NBF
|
||||
// new GameObject("GameManager").AddComponent<GameManager>();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
PermanentCommon.Dispose();
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
ES3.Init();
|
||||
@@ -85,9 +86,11 @@ namespace NBF
|
||||
|
||||
public void StartGame()
|
||||
{
|
||||
PermanentCommon.Init();
|
||||
InputDef.LoadIcon();
|
||||
UI.Inst.OpenUI<FishingShopPanel>();
|
||||
LoadData();
|
||||
//Fishing.Inst.Go(1);
|
||||
// Fishing.Inst.Go(1);
|
||||
}
|
||||
|
||||
private void LoadData()
|
||||
@@ -118,17 +121,15 @@ namespace NBF
|
||||
|
||||
public ControllerType controllerType = ControllerType.GamePad;
|
||||
|
||||
public void SetMouseCurrsor(bool val)
|
||||
public void SetMouseCursor(bool val)
|
||||
{
|
||||
if (val)
|
||||
{
|
||||
// InputManager inputManager = FindObjectOfType<InputManager>();
|
||||
if (controllerType == ControllerType.KeyboardMouse)
|
||||
{
|
||||
Cursor.visible = true;
|
||||
}
|
||||
|
||||
// inputManager.SetCursorPositionToScreenCenter();
|
||||
Cursor.lockState = CursorLockMode.None;
|
||||
}
|
||||
else if (controllerType == ControllerType.KeyboardMouse)
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace NBF
|
||||
{
|
||||
base.OnInit();
|
||||
this.AutoAddClick(OnClick);
|
||||
IsShowCursor = true;
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACursor_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F021f30a9a92b48ce98ae6b39956dd76a1df600_003Fd0_003F709b15ec_003FCursor_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIconAttribute_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F021f30a9a92b48ce98ae6b39956dd76a1df600_003F6a_003F44c4467c_003FIconAttribute_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIMGUIContainer_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fb4f75f0eb2d14004826911645c6175d61fbe00_003F49_003F22dd7281_003FIMGUIContainer_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AKeyCode_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F021f30a9a92b48ce98ae6b39956dd76a1df600_003Fd1_003F01a95d3a_003FKeyCode_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
|
||||
Reference in New Issue
Block a user