diff --git a/Assets/Boot.unity b/Assets/Boot.unity index fa42fd4..26e2ff0 100644 --- a/Assets/Boot.unity +++ b/Assets/Boot.unity @@ -664,7 +664,7 @@ MonoBehaviour: - {fileID: 1281760859} - {fileID: 1557817561} - {fileID: 997852734} - PlayMode: 2 + PlayMode: 0 --- !u!4 &1281760861 Transform: m_ObjectHideFlags: 0 diff --git a/Assets/HybridCLRGenerate/AOTGenericReferences.cs b/Assets/HybridCLRGenerate/AOTGenericReferences.cs index c428be8..db67bd6 100644 --- a/Assets/HybridCLRGenerate/AOTGenericReferences.cs +++ b/Assets/HybridCLRGenerate/AOTGenericReferences.cs @@ -177,7 +177,7 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour // Mirror.Writer // Mirror.Writer // Mirror.Writer - // Singleton + // SingletonMono // System.Action // System.Action // System.Action diff --git a/Assets/Res/Main/UIPanel/MoveCtrlPanel.prefab b/Assets/Res/Main/UIPanel/MoveCtrlPanel.prefab new file mode 100644 index 0000000..30b72ef --- /dev/null +++ b/Assets/Res/Main/UIPanel/MoveCtrlPanel.prefab @@ -0,0 +1,381 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2622675107569439203 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2214663673327293045} + - component: {fileID: 83170536810119783} + - component: {fileID: 6961925507532307712} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2214663673327293045 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2622675107569439203} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3135082838280562044} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 300, y: 300} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &83170536810119783 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2622675107569439203} + m_CullTransparentMesh: 1 +--- !u!114 &6961925507532307712 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2622675107569439203} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 838794475e7fe2e419eec0bcf8f8701b, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &4765551542555879083 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 812303767401788388} + m_Layer: 5 + m_Name: MoveCtrlPanel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &812303767401788388 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4765551542555879083} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3135082838280562044} + - {fileID: 1199787250902103692} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &5149144602705696399 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1199787250902103692} + - component: {fileID: 930958411682697794} + - component: {fileID: 1225361106158314581} + - component: {fileID: 6481945068780627852} + m_Layer: 5 + m_Name: LeftStick + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1199787250902103692 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5149144602705696399} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4241108171391225465} + m_Father: {fileID: 812303767401788388} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 350, y: 350} + m_SizeDelta: {x: 300, y: 3} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &930958411682697794 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5149144602705696399} + m_CullTransparentMesh: 0 +--- !u!114 &1225361106158314581 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5149144602705696399} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 8bd30333489082143a978bd2d0fc8634, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &6481945068780627852 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5149144602705696399} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e9d677f1681015749b15c436eec6d880, type: 3} + m_Name: + m_EditorClassIdentifier: + m_MovementRange: 150 + m_DynamicOriginRange: 300 + m_ControlPath: //LeftStick + m_Behaviour: 2 + m_UseIsolatedInputActions: 0 + m_PointerDownAction: + m_Name: + m_Type: 0 + m_ExpectedControlType: + m_Id: 4b7f3134-e9d7-4cf1-af13-b4c50eba83ce + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_PointerMoveAction: + m_Name: + m_Type: 0 + m_ExpectedControlType: + m_Id: 6e5ab135-fb47-4df0-8482-ed75002e2267 + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 +--- !u!1 &6222679013910671110 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3135082838280562044} + - component: {fileID: 2907130619251162551} + - component: {fileID: 9182923056212564042} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3135082838280562044 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6222679013910671110} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2214663673327293045} + m_Father: {fileID: 812303767401788388} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 350, y: 350} + m_SizeDelta: {x: 300, y: 300} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2907130619251162551 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6222679013910671110} + m_CullTransparentMesh: 1 +--- !u!114 &9182923056212564042 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6222679013910671110} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 894062b635dc9a54bb9df1c208d32c79, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &7278469045809088049 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4241108171391225465} + - component: {fileID: 3367107405248681136} + - component: {fileID: 855174502794761129} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4241108171391225465 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7278469045809088049} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1199787250902103692} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 2, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3367107405248681136 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7278469045809088049} + m_CullTransparentMesh: 0 +--- !u!114 &855174502794761129 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7278469045809088049} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Left Stick diff --git a/Assets/Res/Main/UIPanel/MoveCtrlPanel.prefab.meta b/Assets/Res/Main/UIPanel/MoveCtrlPanel.prefab.meta new file mode 100644 index 0000000..66d6488 --- /dev/null +++ b/Assets/Res/Main/UIPanel/MoveCtrlPanel.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d7feabdb3e412124b836a15184af7f2e +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/Input System/1.14.2/On-Screen Controls/OnScreenControlsSample.unity b/Assets/Samples/Input System/1.14.2/On-Screen Controls/OnScreenControlsSample.unity index 979769f..8ddf9b1 100644 --- a/Assets/Samples/Input System/1.14.2/On-Screen Controls/OnScreenControlsSample.unity +++ b/Assets/Samples/Input System/1.14.2/On-Screen Controls/OnScreenControlsSample.unity @@ -122,133 +122,6 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!1001 &182059024 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 1993296955} - m_Modifications: - - target: {fileID: 1613174875475300, guid: f77f88b14a477764bb65a49d28c02d33, type: 3} - propertyPath: m_Name - value: LeftStick - objectReference: {fileID: 0} - - target: {fileID: 114480945186419424, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_Behaviour - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 114480945186419424, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_MovementRange - value: 300 - objectReference: {fileID: 0} - - target: {fileID: 114480945186419424, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_DynamicOriginRange - value: 300 - objectReference: {fileID: 0} - - target: {fileID: 114480945186419424, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_DynamicOriginClickable - value: - objectReference: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} - - target: {fileID: 224091927000801720, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_Pivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 224091927000801720, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_Pivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 224091927000801720, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_RootOrder - value: 4 - objectReference: {fileID: 0} - - target: {fileID: 224091927000801720, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_AnchorMax.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 224091927000801720, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_AnchorMax.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 224091927000801720, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_AnchorMin.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 224091927000801720, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_AnchorMin.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 224091927000801720, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_SizeDelta.x - value: 100 - objectReference: {fileID: 0} - - target: {fileID: 224091927000801720, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_SizeDelta.y - value: 100 - objectReference: {fileID: 0} - - target: {fileID: 224091927000801720, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224091927000801720, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224091927000801720, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224091927000801720, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 224091927000801720, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224091927000801720, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224091927000801720, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224091927000801720, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_AnchoredPosition.x - value: -161 - objectReference: {fileID: 0} - - target: {fileID: 224091927000801720, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - propertyPath: m_AnchoredPosition.y - value: -129 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: f77f88b14a477764bb65a49d28c02d33, type: 3} --- !u!1001 &213445084 PrefabInstance: m_ObjectHideFlags: 0 @@ -366,12 +239,6 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 05f32eddd3e41fd4597ada617b785928, type: 3} ---- !u!224 &223523015 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 224091927000801720, guid: f77f88b14a477764bb65a49d28c02d33, - type: 3} - m_PrefabInstance: {fileID: 182059024} - m_PrefabAsset: {fileID: 0} --- !u!1001 &334844325 PrefabInstance: m_ObjectHideFlags: 0 @@ -1161,8 +1028,8 @@ RectTransform: - {fileID: 827737258} - {fileID: 1467932573} - {fileID: 334844326} - - {fileID: 223523015} - {fileID: 1763776551} + - {fileID: 2963455855290732268} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -1184,6 +1051,8 @@ MonoBehaviour: m_EditorClassIdentifier: inputAction: {fileID: 2145626033925996126, guid: efc74d62e0aa605438ae41c388786ef8, type: 3} + ParentObj: {fileID: 713718991246645364} + onScreenStick: {fileID: 8904126831151913604} --- !u!850595691 &2075976824 LightingSettings: m_ObjectHideFlags: 0 @@ -1248,6 +1117,385 @@ LightingSettings: m_PVRTiledBaking: 0 m_NumRaysToShootPerTexel: -1 m_RespectSceneVisibilityWhenBakingGI: 0 +--- !u!1 &432402199150701803 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4384745167881809789} + - component: {fileID: 2540828120232935279} + - component: {fileID: 4825629831811530760} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &713718991246645364 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8376355588769731086} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4384745167881809789} + m_Father: {fileID: 2963455855290732268} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -589.99994, y: -128.99998} + m_SizeDelta: {x: 300, y: 300} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &737919063412850879 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8376355588769731086} + m_CullTransparentMesh: 1 +--- !u!222 &927724787126069688 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5145362127522282297} + m_CullTransparentMesh: 0 +--- !u!224 &1783108751789781873 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5145362127522282297} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3657818702438058884} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 2, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2540828120232935279 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 432402199150701803} + m_CullTransparentMesh: 1 +--- !u!224 &2963455855290732268 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6937528586866629539} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 713718991246645364} + - {fileID: 3657818702438058884} + m_Father: {fileID: 1993296955} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &3007171117402795681 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5145362127522282297} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Left Stick +--- !u!222 &3354833319183544138 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7282532954179545991} + m_CullTransparentMesh: 0 +--- !u!224 &3657818702438058884 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7282532954179545991} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1783108751789781873} + m_Father: {fileID: 2963455855290732268} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -590, y: -129} + m_SizeDelta: {x: 300, y: 300} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &3703355205647292765 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7282532954179545991} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 8bd30333489082143a978bd2d0fc8634, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!224 &4384745167881809789 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 432402199150701803} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 713718991246645364} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 300, y: 300} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &4825629831811530760 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 432402199150701803} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 838794475e7fe2e419eec0bcf8f8701b, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &5145362127522282297 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1783108751789781873} + - component: {fileID: 927724787126069688} + - component: {fileID: 3007171117402795681} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &6707519295810528578 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8376355588769731086} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 894062b635dc9a54bb9df1c208d32c79, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &6937528586866629539 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2963455855290732268} + m_Layer: 5 + m_Name: MoveCtrlPanel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &7282532954179545991 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3657818702438058884} + - component: {fileID: 3354833319183544138} + - component: {fileID: 3703355205647292765} + - component: {fileID: 8904126831151913604} + m_Layer: 5 + m_Name: LeftStick + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &8376355588769731086 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 713718991246645364} + - component: {fileID: 737919063412850879} + - component: {fileID: 6707519295810528578} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &8904126831151913604 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7282532954179545991} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e9d677f1681015749b15c436eec6d880, type: 3} + m_Name: + m_EditorClassIdentifier: + m_MovementRange: 150 + m_DynamicOriginRange: 300 + m_ControlPath: //LeftStick + m_Behaviour: 2 + m_UseIsolatedInputActions: 0 + m_PointerDownAction: + m_Name: + m_Type: 0 + m_ExpectedControlType: + m_Id: 4b7f3134-e9d7-4cf1-af13-b4c50eba83ce + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_PointerMoveAction: + m_Name: + m_Type: 0 + m_ExpectedControlType: + m_Id: 6e5ab135-fb47-4df0-8482-ed75002e2267 + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 diff --git a/Assets/Samples/Input System/1.14.2/On-Screen Controls/ScreenTest.cs b/Assets/Samples/Input System/1.14.2/On-Screen Controls/ScreenTest.cs index e7deb65..ba7b213 100644 --- a/Assets/Samples/Input System/1.14.2/On-Screen Controls/ScreenTest.cs +++ b/Assets/Samples/Input System/1.14.2/On-Screen Controls/ScreenTest.cs @@ -2,14 +2,27 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.InputSystem; +using UnityEngine.InputSystem.OnScreen; public class ScreenTest : MonoBehaviour { public InputActionReference inputAction; + public RectTransform ParentObj; + public OnScreenStick onScreenStick; + Vector2 startPos; // Start is called before the first frame update void Start() { + startPos = ParentObj.anchoredPosition; inputAction.action.Enable(); inputAction.action.performed += ScreenTouchTest; + onScreenStick.onPointerDown += () => + { + ParentObj.anchoredPosition = onScreenStick.PointerDownPos; + }; + onScreenStick.onPointerUp += () => + { + ParentObj.anchoredPosition = startPos; + }; } private void ScreenTouchTest(InputAction.CallbackContext obj) diff --git a/Assets/Scripts/HotUpdate/Main/GameStart.cs b/Assets/Scripts/HotUpdate/Main/GameStart.cs index 90b8010..c7d13dd 100644 --- a/Assets/Scripts/HotUpdate/Main/GameStart.cs +++ b/Assets/Scripts/HotUpdate/Main/GameStart.cs @@ -10,7 +10,7 @@ public class GameStart : MonoBehaviour { DontDestroyOnLoad(gameObject); StartCoroutine(LoadScene()); - StartCoroutine(LoadUIManager()); + //StartCoroutine(LoadUIManager()); } IEnumerator LoadScene() { @@ -23,17 +23,17 @@ public class GameStart : MonoBehaviour }; yield return sceneHandle; } - IEnumerator LoadUIManager() - { - AssetHandle _handle = YooAssets.LoadAssetAsync("UIManager"); - _handle.Completed += (handle) => - { - GameObject go = Instantiate((GameObject)_handle.AssetObject); - DontDestroyOnLoad(go); - Debug.Log(_handle.AssetObject); - }; - yield return _handle; - } + //IEnumerator LoadUIManager() + //{ + // AssetHandle _handle = YooAssets.LoadAssetAsync("UIManager"); + // _handle.Completed += (handle) => + // { + // GameObject go = Instantiate((GameObject)_handle.AssetObject); + // DontDestroyOnLoad(go); + // Debug.Log(_handle.AssetObject); + // }; + // yield return _handle; + //} IEnumerator LoadNetWorkHUD() { AssetHandle _handle = YooAssets.LoadAssetAsync("MyNetWorkHUD"); diff --git a/Assets/Scripts/HotUpdate/Main/Player/NetWorkThirdCharacterController.cs b/Assets/Scripts/HotUpdate/Main/Player/NetWorkThirdCharacterController.cs index 2ca6977..ecd462d 100644 --- a/Assets/Scripts/HotUpdate/Main/Player/NetWorkThirdCharacterController.cs +++ b/Assets/Scripts/HotUpdate/Main/Player/NetWorkThirdCharacterController.cs @@ -36,7 +36,6 @@ public class NetWorkThirdCharacterController : NetworkBehaviour //if (!isLocalPlayer) return; framingTransposer = vCam.GetCinemachineComponent(); pov = vCam.GetCinemachineComponent(); - UpdateCursorState(); } void Update() { @@ -120,16 +119,16 @@ public class NetWorkThirdCharacterController : NetworkBehaviour if (!isLocalPlayer) return; if (context.performed) { - isCursorLocked = !isCursorLocked; - UpdateCursorState(); - if (isCursorLocked) - { - SettingsManager.Instance.CloseSettingWindow(); - } - else - { - SettingsManager.Instance.OpenSettingWindow(); - } + //isCursorLocked = SettingsManager.Inst.isShow(); + //UpdateCursorState(); + //if (SettingsManager.Inst.isShow()) + //{ + // SettingsManager.Inst.CloseSettingWindow(); + //} + //else + //{ + // SettingsManager.Inst.OpenSettingWindow(); + //} } } public void OnAlt(InputAction.CallbackContext context) @@ -197,6 +196,7 @@ public class NetWorkThirdCharacterController : NetworkBehaviour { Debug.Log("OnStartLocalPlayer"); vCam.Priority = 15; + UpdateCursorState(); } /// diff --git a/Assets/Scripts/HotUpdate/Main/Player/ThirdCharacterController.cs b/Assets/Scripts/HotUpdate/Main/Player/ThirdCharacterController.cs index b57e1c3..446091f 100644 --- a/Assets/Scripts/HotUpdate/Main/Player/ThirdCharacterController.cs +++ b/Assets/Scripts/HotUpdate/Main/Player/ThirdCharacterController.cs @@ -115,14 +115,14 @@ public class ThirdCharacterController : MonoBehaviour { isCursorLocked = !isCursorLocked; UpdateCursorState(); - if (isCursorLocked) - { - SettingsManager.Instance.CloseSettingWindow(); - } - else - { - SettingsManager.Instance.OpenSettingWindow(); - } + //if (SettingsManager.Inst.isShow()) + //{ + // SettingsManager.Inst.CloseSettingWindow(); + //} + //else + //{ + // SettingsManager.Inst.OpenSettingWindow(); + //} } } public void OnFire(InputAction.CallbackContext context) diff --git a/Assets/Scripts/HotUpdate/Main/SettingWindow/GeneralPanel.cs b/Assets/Scripts/HotUpdate/Main/SettingWindow/GeneralPanel.cs deleted file mode 100644 index d387afb..0000000 --- a/Assets/Scripts/HotUpdate/Main/SettingWindow/GeneralPanel.cs +++ /dev/null @@ -1,18 +0,0 @@ -using TMPro; -using UnityEngine; -using UnityEngine.UI; - -public class GeneralPanel : MonoBehaviour -{ - [SerializeField] private TMP_InputField serverAddressInput; - - private void OnEnable() - { - serverAddressInput.text = SettingsManager.Instance.CurrentSettings.serverAddress; - } - - public void OnServerAddressChanged(string value) - { - SettingsManager.Instance.CurrentSettings.serverAddress = value; - } -} \ No newline at end of file diff --git a/Assets/Scripts/HotUpdate/Main/SettingWindow/SettingsWindow.cs b/Assets/Scripts/HotUpdate/Main/SettingWindow/SettingsWindow.cs deleted file mode 100644 index 1e92587..0000000 --- a/Assets/Scripts/HotUpdate/Main/SettingWindow/SettingsWindow.cs +++ /dev/null @@ -1,90 +0,0 @@ -using UnityEngine; -using UnityEngine.UI; - -public class SettingsWindow : MonoBehaviour -{ - [Header("Panels")] - public GameObject generalPanel; - public GameObject audioPanel; - public GameObject graphicsPanel; - public GameObject displayPanel; - - [Header("Tab Buttons")] - public Button generalTab; - public Button audioTab; - public Button graphicsTab; - public Button displayTab; - - [Header("Action Buttons")] - public Button applyButton; - public Button cancelButton; - public Button defaultsButton; - public Button quitButton; - - private GameObject currentPanel; - - private void Awake() - { - // 初始化标签页按钮 - generalTab.onClick.AddListener(() => SwitchPanel(generalPanel)); - audioTab.onClick.AddListener(() => SwitchPanel(audioPanel)); - graphicsTab.onClick.AddListener(() => SwitchPanel(graphicsPanel)); - displayTab.onClick.AddListener(() => SwitchPanel(displayPanel)); - - // 初始化动作按钮 - applyButton.onClick.AddListener(ApplyAllSettings); - cancelButton.onClick.AddListener(CloseWindow); - defaultsButton.onClick.AddListener(ResetToDefaults); - quitButton.onClick.AddListener(() => { Application.Quit(); }); - - // 默认打开第一个面板 - SwitchPanel(generalPanel); - } - - private void SwitchPanel(GameObject newPanel) - { - if (currentPanel != null) - currentPanel.SetActive(false); - - newPanel.SetActive(true); - currentPanel = newPanel; - UpdateTabButtons(); - } - - private void UpdateTabButtons() - { - generalTab.interactable = currentPanel != generalPanel; - audioTab.interactable = currentPanel != audioPanel; - graphicsTab.interactable = currentPanel != graphicsPanel; - displayTab.interactable = currentPanel != displayPanel; - } - - public void ApplyAllSettings() - { - // 应用显示设置(需要最先执行) - displayPanel.GetComponent().ApplySettings(); - - // 应用图形设置 - graphicsPanel.GetComponent().ApplySettings(); - - // 应用音频设置 - audioPanel.GetComponent().ApplySettings(); - - // 保存所有设置 - SettingsManager.Instance.SaveSettings(); - - CloseWindow(); - } - - public void CloseWindow() - { - // 重新加载设置以取消未保存的更改 - SettingsManager.Instance.LoadSettings(); - gameObject.SetActive(false); - } - public void ResetToDefaults() - { - SettingsManager.Instance.ResetToDefaultSettings(); - SwitchPanel(currentPanel); // 刷新当前面板 - } -} \ No newline at end of file diff --git a/Assets/Scripts/HotUpdate/Main/AutoChess.meta b/Assets/Scripts/HotUpdate/Main/UI.meta similarity index 100% rename from Assets/Scripts/HotUpdate/Main/AutoChess.meta rename to Assets/Scripts/HotUpdate/Main/UI.meta diff --git a/Assets/Scripts/HotUpdate/Main/UI/Base.meta b/Assets/Scripts/HotUpdate/Main/UI/Base.meta new file mode 100644 index 0000000..86e6caa --- /dev/null +++ b/Assets/Scripts/HotUpdate/Main/UI/Base.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2c613363e91e7c64f86144bb2d1170ed +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/HotUpdate/Main/UI/Base/UIBasePanel.cs b/Assets/Scripts/HotUpdate/Main/UI/Base/UIBasePanel.cs new file mode 100644 index 0000000..752c0d5 --- /dev/null +++ b/Assets/Scripts/HotUpdate/Main/UI/Base/UIBasePanel.cs @@ -0,0 +1,11 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public abstract class UIBasePanel : MonoBehaviour +{ + public virtual void OnShow() { } + public virtual void OnHide() { } + + public virtual void Refresh() { } +} diff --git a/Assets/Scripts/HotUpdate/Main/UI/Base/UIBasePanel.cs.meta b/Assets/Scripts/HotUpdate/Main/UI/Base/UIBasePanel.cs.meta new file mode 100644 index 0000000..e3483a9 --- /dev/null +++ b/Assets/Scripts/HotUpdate/Main/UI/Base/UIBasePanel.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2bf3cc6e9e21be7419df9ca4faedb67f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/HotUpdate/Main/UI/Base/UIBaseWindow.cs b/Assets/Scripts/HotUpdate/Main/UI/Base/UIBaseWindow.cs new file mode 100644 index 0000000..15d41a9 --- /dev/null +++ b/Assets/Scripts/HotUpdate/Main/UI/Base/UIBaseWindow.cs @@ -0,0 +1,19 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public abstract class UIBaseWindow : MonoBehaviour +{ + public virtual void Show() + { + gameObject.SetActive(true); + OnShow(); + } + public virtual void Hide() + { + gameObject.SetActive(true); + OnHide(); + } + protected virtual void OnShow() { } + protected virtual void OnHide() { } +} diff --git a/Assets/Scripts/HotUpdate/Main/UI/Base/UIBaseWindow.cs.meta b/Assets/Scripts/HotUpdate/Main/UI/Base/UIBaseWindow.cs.meta new file mode 100644 index 0000000..886a98d --- /dev/null +++ b/Assets/Scripts/HotUpdate/Main/UI/Base/UIBaseWindow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e3f28a4ac0387cf41a8955b532a5fd19 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/HotUpdate/Main/UI/MoveCtrlPanel.meta b/Assets/Scripts/HotUpdate/Main/UI/MoveCtrlPanel.meta new file mode 100644 index 0000000..84578fe --- /dev/null +++ b/Assets/Scripts/HotUpdate/Main/UI/MoveCtrlPanel.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 865cfb005c2e42a4783a9f7eaa74c930 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/HotUpdate/Main/SettingWindow.meta b/Assets/Scripts/HotUpdate/Main/UI/SettingWindow.meta similarity index 100% rename from Assets/Scripts/HotUpdate/Main/SettingWindow.meta rename to Assets/Scripts/HotUpdate/Main/UI/SettingWindow.meta diff --git a/Assets/Scripts/HotUpdate/Main/SettingWindow/AudioPanel.cs b/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/AudioPanel.cs similarity index 61% rename from Assets/Scripts/HotUpdate/Main/SettingWindow/AudioPanel.cs rename to Assets/Scripts/HotUpdate/Main/UI/SettingWindow/AudioPanel.cs index 9653d94..391bb5d 100644 --- a/Assets/Scripts/HotUpdate/Main/SettingWindow/AudioPanel.cs +++ b/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/AudioPanel.cs @@ -2,26 +2,26 @@ using UnityEngine; using UnityEngine.UI; using UnityEngine.Audio; -public class AudioPanel : MonoBehaviour +public class AudioPanel : UIBasePanel, ISettingsPanel { [SerializeField] private Slider masterVolumeSlider; [SerializeField] private AudioMixer audioMixer; private void OnEnable() { - masterVolumeSlider.value = SettingsManager.Instance.CurrentSettings.masterVolume; + masterVolumeSlider.value = SettingsManager.Inst.CurrentSettings.masterVolume; if (audioMixer == null) audioMixer = FindAnyObjectByType(); } public void OnMasterVolumeChanged(float value) { - SettingsManager.Instance.CurrentSettings.masterVolume = value; + SettingsManager.Inst.CurrentSettings.masterVolume = value; SetVolume(value); } public void ApplySettings() { - SetVolume(SettingsManager.Instance.CurrentSettings.masterVolume); + SetVolume(SettingsManager.Inst.CurrentSettings.masterVolume); } private void SetVolume(float volume) @@ -29,4 +29,9 @@ public class AudioPanel : MonoBehaviour if (audioMixer) audioMixer.SetFloat("MasterVolume", Mathf.Log10(Mathf.Max(volume, 0.0001f)) * 20); } + + public void ResetToDefault() + { + throw new System.NotImplementedException(); + } } \ No newline at end of file diff --git a/Assets/Scripts/HotUpdate/Main/SettingWindow/AudioPanel.cs.meta b/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/AudioPanel.cs.meta similarity index 100% rename from Assets/Scripts/HotUpdate/Main/SettingWindow/AudioPanel.cs.meta rename to Assets/Scripts/HotUpdate/Main/UI/SettingWindow/AudioPanel.cs.meta diff --git a/Assets/Scripts/HotUpdate/Main/SettingWindow/DisplayPanel.cs b/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/DisplayPanel.cs similarity index 84% rename from Assets/Scripts/HotUpdate/Main/SettingWindow/DisplayPanel.cs rename to Assets/Scripts/HotUpdate/Main/UI/SettingWindow/DisplayPanel.cs index c03083b..70e87bc 100644 --- a/Assets/Scripts/HotUpdate/Main/SettingWindow/DisplayPanel.cs +++ b/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/DisplayPanel.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using TMPro; using System.Collections; -public class DisplayPanel : MonoBehaviour +public class DisplayPanel : UIBasePanel, ISettingsPanel { [Header("UI References")] [SerializeField] private TMP_Dropdown resolutionDropdown; @@ -27,7 +27,7 @@ public class DisplayPanel : MonoBehaviour IEnumerator InitializeDelayed() { yield return null; - var settings = SettingsManager.Instance.CurrentSettings; + var settings = SettingsManager.Inst.CurrentSettings; resolutionDropdown.SetValueWithoutNotify(settings.resolutionIndex); fullscreenToggle.SetIsOnWithoutNotify(settings.fullscreen); @@ -45,7 +45,6 @@ public class DisplayPanel : MonoBehaviour var options = new List(); for (int i = 0; i < resolutions.Length; i++) { - // 使用refreshRateRatio代替过时的refreshRate int refreshRate = Mathf.RoundToInt((float)resolutions[i].refreshRateRatio.value); options.Add($"{resolutions[i].width}x{resolutions[i].height} {refreshRate}Hz"); } @@ -68,26 +67,26 @@ public class DisplayPanel : MonoBehaviour public void OnResolutionChanged(int index) { - SettingsManager.Instance.CurrentSettings.resolutionIndex = index; + SettingsManager.Inst.CurrentSettings.resolutionIndex = index; ApplySetResolution(); } public void OnFullscreenChanged(bool value) { - SettingsManager.Instance.CurrentSettings.fullscreen = value; + SettingsManager.Inst.CurrentSettings.fullscreen = value; UpdateBorderlessToggleState(); ApplySetResolution(); } public void OnBorderlessChanged(bool value) { - SettingsManager.Instance.CurrentSettings.borderless = value; + SettingsManager.Inst.CurrentSettings.borderless = value; ApplySetResolution(); } public void OnDisplayChanged(int index) { - SettingsManager.Instance.CurrentSettings.displayIndex = index; + SettingsManager.Inst.CurrentSettings.displayIndex = index; ApplySetDisplay(); } @@ -108,7 +107,7 @@ public class DisplayPanel : MonoBehaviour void ApplySetResolution() { if (resolutions == null) return; - var settings = SettingsManager.Instance.CurrentSettings; + var settings = SettingsManager.Inst.CurrentSettings; Resolution res = resolutions[resolutions.Length-1]; if (settings.resolutionIndex < resolutions.Length && settings.resolutionIndex>=0) { @@ -119,7 +118,6 @@ public class DisplayPanel : MonoBehaviour FullScreenMode.FullScreenWindow : (settings.fullscreen ? FullScreenMode.ExclusiveFullScreen : FullScreenMode.Windowed); - // 使用refreshRateRatio代替过时的refreshRate Screen.SetResolution( res.width, res.height, @@ -129,10 +127,15 @@ public class DisplayPanel : MonoBehaviour } void ApplySetDisplay() { - var settings = SettingsManager.Instance.CurrentSettings; + var settings = SettingsManager.Inst.CurrentSettings; if (settings.displayIndex > 0 && settings.displayIndex < Display.displays.Length) { Display.displays[settings.displayIndex].Activate(); } } + + public void ResetToDefault() + { + throw new System.NotImplementedException(); + } } \ No newline at end of file diff --git a/Assets/Scripts/HotUpdate/Main/SettingWindow/DisplayPanel.cs.meta b/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/DisplayPanel.cs.meta similarity index 100% rename from Assets/Scripts/HotUpdate/Main/SettingWindow/DisplayPanel.cs.meta rename to Assets/Scripts/HotUpdate/Main/UI/SettingWindow/DisplayPanel.cs.meta diff --git a/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/GeneralPanel.cs b/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/GeneralPanel.cs new file mode 100644 index 0000000..dcc2674 --- /dev/null +++ b/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/GeneralPanel.cs @@ -0,0 +1,33 @@ +using TMPro; +using UnityEngine; +using UnityEngine.UI; + +public class GeneralPanel : UIBasePanel,ISettingsPanel +{ + [SerializeField] private TMP_InputField serverAddressInput; + + public override void OnShow() + { + serverAddressInput.text = SettingsManager.Inst.CurrentSettings.serverAddress; + base.Refresh(); + } + public override void Refresh() + { + base.Refresh(); + } + + public void OnServerAddressChanged(string value) + { + SettingsManager.Inst.CurrentSettings.serverAddress = value; + } + + public void ApplySettings() + { + // SettingsManager.Inst.CurrentSettings.serverAddress = value; + } + + public void ResetToDefault() + { + + } +} \ No newline at end of file diff --git a/Assets/Scripts/HotUpdate/Main/SettingWindow/GeneralPanel.cs.meta b/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/GeneralPanel.cs.meta similarity index 100% rename from Assets/Scripts/HotUpdate/Main/SettingWindow/GeneralPanel.cs.meta rename to Assets/Scripts/HotUpdate/Main/UI/SettingWindow/GeneralPanel.cs.meta diff --git a/Assets/Scripts/HotUpdate/Main/SettingWindow/GraphicsPanel.cs b/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/GraphicsPanel.cs similarity index 83% rename from Assets/Scripts/HotUpdate/Main/SettingWindow/GraphicsPanel.cs rename to Assets/Scripts/HotUpdate/Main/UI/SettingWindow/GraphicsPanel.cs index 80f1793..00b48b7 100644 --- a/Assets/Scripts/HotUpdate/Main/SettingWindow/GraphicsPanel.cs +++ b/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/GraphicsPanel.cs @@ -5,7 +5,7 @@ using UnityEngine.Rendering.Universal; using TMPro; using System.Collections; -public class GraphicsPanel : MonoBehaviour +public class GraphicsPanel : UIBasePanel, ISettingsPanel { [Header("UI References")] [SerializeField] private TMP_Dropdown qualityDropdown; @@ -61,26 +61,23 @@ public class GraphicsPanel : MonoBehaviour private IEnumerator InitializeDelayed() { - yield return null; // 等待一帧确保URP初始化 + yield return null; - // 获取URP Asset _urpAsset = GraphicsSettings.currentRenderPipeline as UniversalRenderPipelineAsset; if (_urpAsset == null) { - Debug.LogError("无法获取URP Asset,请确保项目使用URP"); + Debug.LogError("URP Asset null"); yield break; } - // 获取Bloom效果 if (urpVolumeProfile != null && !urpVolumeProfile.TryGet(out _bloom)) { - Debug.LogWarning("Volume Profile中未找到Bloom效果"); + Debug.LogWarning("Volume Profile Bloom null"); } - // 初始化UI //InitializeQualityDropdown(); - var settings = SettingsManager.Instance.CurrentSettings; + var settings = SettingsManager.Inst.CurrentSettings; qualityDropdown.SetValueWithoutNotify(settings.qualityLevel); vsyncToggle.SetIsOnWithoutNotify(settings.vsyncEnabled); shadowDistanceSlider.SetValueWithoutNotify(settings.shadowDistance); @@ -102,13 +99,13 @@ public class GraphicsPanel : MonoBehaviour public void OnQualityChanged(int index) { - SettingsManager.Instance.CurrentSettings.qualityLevel = index; - var settings = SettingsManager.Instance.CurrentSettings; + SettingsManager.Inst.CurrentSettings.qualityLevel = index; + var settings = SettingsManager.Inst.CurrentSettings; if (index >= 0 && index < qualityPresets.Length) { var preset = qualityPresets[index]; - // 应用预设的所有设置 + // 应锟斤拷预锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟 vsyncToggle.SetIsOnWithoutNotify(preset.vsyncEnabled); shadowDistanceSlider.SetValueWithoutNotify(preset.shadowDistance); antiAliasingDropdown.SetValueWithoutNotify(preset.antiAliasing); @@ -116,7 +113,7 @@ public class GraphicsPanel : MonoBehaviour renderScaleSlider.SetValueWithoutNotify(preset.renderScale); } - // 立即应用设置 + // 锟斤拷锟斤拷应锟斤拷锟斤拷锟斤拷 OnVSyncChanged(settings.vsyncEnabled); OnShadowDistanceChanged(settings.shadowDistance); OnAntiAliasingChanged(settings.antiAliasing); @@ -126,34 +123,34 @@ public class GraphicsPanel : MonoBehaviour public void OnVSyncChanged(bool value) { - SettingsManager.Instance.CurrentSettings.vsyncEnabled = value; + SettingsManager.Inst.CurrentSettings.vsyncEnabled = value; QualitySettings.vSyncCount = value ? 1 : 0; } public void OnShadowDistanceChanged(float value) { - SettingsManager.Instance.CurrentSettings.shadowDistance = value; + SettingsManager.Inst.CurrentSettings.shadowDistance = value; if (_urpAsset != null) _urpAsset.shadowDistance = value; } public void OnAntiAliasingChanged(int index) { - SettingsManager.Instance.CurrentSettings.antiAliasing = index; + SettingsManager.Inst.CurrentSettings.antiAliasing = index; if (_urpAsset != null) _urpAsset.msaaSampleCount = (int)Mathf.Pow(2, index); } public void OnBloomChanged(bool value) { - SettingsManager.Instance.CurrentSettings.bloomEnabled = value; + SettingsManager.Inst.CurrentSettings.bloomEnabled = value; if (_bloom != null) _bloom.active = value; } public void OnRenderScaleChanged(float value) { - SettingsManager.Instance.CurrentSettings.renderScale = value; + SettingsManager.Inst.CurrentSettings.renderScale = value; if (_urpAsset != null) _urpAsset.renderScale = value; } @@ -162,7 +159,7 @@ public class GraphicsPanel : MonoBehaviour { if (_urpAsset == null) return; - var settings = SettingsManager.Instance.CurrentSettings; + var settings = SettingsManager.Inst.CurrentSettings; if (settings.qualityLevel != 4) QualitySettings.SetQualityLevel(settings.qualityLevel); QualitySettings.vSyncCount = settings.vsyncEnabled ? 1 : 0; @@ -173,4 +170,9 @@ public class GraphicsPanel : MonoBehaviour if (_bloom != null) _bloom.active = settings.bloomEnabled; } + + public void ResetToDefault() + { + throw new System.NotImplementedException(); + } } \ No newline at end of file diff --git a/Assets/Scripts/HotUpdate/Main/SettingWindow/GraphicsPanel.cs.meta b/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/GraphicsPanel.cs.meta similarity index 100% rename from Assets/Scripts/HotUpdate/Main/SettingWindow/GraphicsPanel.cs.meta rename to Assets/Scripts/HotUpdate/Main/UI/SettingWindow/GraphicsPanel.cs.meta diff --git a/Assets/Scripts/HotUpdate/Main/SettingWindow/SettingsManager.cs b/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/SettingsManager.cs similarity index 58% rename from Assets/Scripts/HotUpdate/Main/SettingWindow/SettingsManager.cs rename to Assets/Scripts/HotUpdate/Main/UI/SettingWindow/SettingsManager.cs index be8f3a3..1612c56 100644 --- a/Assets/Scripts/HotUpdate/Main/SettingWindow/SettingsManager.cs +++ b/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/SettingsManager.cs @@ -3,28 +3,16 @@ using System.IO; using YooAsset; using System; -public class SettingsManager : MonoBehaviour +public class SettingsManager: Singleton { - public static SettingsManager Instance { get; private set; } - private GameSettings _currentSettings; - private SettingsWindow settingsWindow; public GameSettings CurrentSettings => _currentSettings; private string settingsPath; - - private void Awake() + public SettingsManager() { - if (Instance != null && Instance != this) - { - Destroy(gameObject); - return; - } - - Instance = this; - DontDestroyOnLoad(gameObject); - settingsPath = Path.Combine(Application.persistentDataPath, "settings.json"); LoadSettings(); + Debug.Log("SettingsManager 鍒濆鍖栧畬鎴"); } public void LoadSettings() @@ -50,27 +38,6 @@ public class SettingsManager : MonoBehaviour _currentSettings = new GameSettings(); SaveSettings(); } - public void OpenSettingWindow() - { - if (settingsWindow != null) - { - settingsWindow.gameObject.SetActive(true); - } - else - { - YooAssets.LoadAssetAsync("SettingsWindow").Completed += (handle) => - { - settingsWindow = GameObject.Instantiate((GameObject)handle.AssetObject, GameManager.Inst.MainUICanvas.transform).GetComponent(); - }; - } - } - public void CloseSettingWindow() - { - if (settingsWindow != null) - { - settingsWindow.gameObject.SetActive(false); - } - } } [System.Serializable] @@ -91,4 +58,9 @@ public class GameSettings public bool fullscreen = true; public bool borderless = false; public int displayIndex = 0; +} +public interface ISettingsPanel +{ + void ApplySettings(); + void ResetToDefault(); } \ No newline at end of file diff --git a/Assets/Scripts/HotUpdate/Main/SettingWindow/SettingsManager.cs.meta b/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/SettingsManager.cs.meta similarity index 100% rename from Assets/Scripts/HotUpdate/Main/SettingWindow/SettingsManager.cs.meta rename to Assets/Scripts/HotUpdate/Main/UI/SettingWindow/SettingsManager.cs.meta diff --git a/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/SettingsWindow.cs b/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/SettingsWindow.cs new file mode 100644 index 0000000..fd432d9 --- /dev/null +++ b/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/SettingsWindow.cs @@ -0,0 +1,83 @@ +using UnityEngine; +using UnityEngine.UI; + +public class SettingsWindow : UIBaseWindow +{ + [Header("Panels")] + public GeneralPanel generalPanel; + public AudioPanel audioPanel; + public GraphicsPanel graphicsPanel; + public DisplayPanel displayPanel; + + [Header("Tab Buttons")] + public Button generalTab; + public Button audioTab; + public Button graphicsTab; + public Button displayTab; + + [Header("Action Buttons")] + public Button applyButton; + public Button cancelButton; + public Button defaultsButton; + public Button quitButton; + + private UIBasePanel currentPanel; + bool init = false; + + protected override void OnShow() + { + if (!init) + { + generalTab.onClick.AddListener(() => SwitchPanel(generalPanel)); + audioTab.onClick.AddListener(() => SwitchPanel(audioPanel)); + graphicsTab.onClick.AddListener(() => SwitchPanel(graphicsPanel)); + displayTab.onClick.AddListener(() => SwitchPanel(displayPanel)); + + applyButton.onClick.AddListener(ApplyAllSettings); + cancelButton.onClick.AddListener(() => { UIManager.Inst.HideWindow(gameObject.name); }); + defaultsButton.onClick.AddListener(ResetToDefaults); + quitButton.onClick.AddListener(() => { Application.Quit(); }); + } + SwitchPanel(generalPanel); + base.OnShow(); + } + + private void SwitchPanel(UIBasePanel newPanel) + { + if (currentPanel != null) + currentPanel.gameObject.SetActive(false); + + newPanel.gameObject.SetActive(true); + currentPanel = newPanel; + UpdateTabButtons(); + } + + private void UpdateTabButtons() + { + generalTab.interactable = currentPanel != generalPanel; + audioTab.interactable = currentPanel != audioPanel; + graphicsTab.interactable = currentPanel != graphicsPanel; + displayTab.interactable = currentPanel != displayPanel; + } + + public void ApplyAllSettings() + { + generalPanel.ApplySettings(); + + displayPanel.ApplySettings(); + + graphicsPanel.ApplySettings(); + + audioPanel.ApplySettings(); + + SettingsManager.Inst.SaveSettings(); + + UIManager.Inst.HideWindow(gameObject.name); + } + + public void ResetToDefaults() + { + SettingsManager.Inst.ResetToDefaultSettings(); + SwitchPanel(currentPanel); + } +} \ No newline at end of file diff --git a/Assets/Scripts/HotUpdate/Main/SettingWindow/SettingsWindow.cs.meta b/Assets/Scripts/HotUpdate/Main/UI/SettingWindow/SettingsWindow.cs.meta similarity index 100% rename from Assets/Scripts/HotUpdate/Main/SettingWindow/SettingsWindow.cs.meta rename to Assets/Scripts/HotUpdate/Main/UI/SettingWindow/SettingsWindow.cs.meta diff --git a/Assets/Scripts/HotUpdate/Main/UI/UIManager.cs b/Assets/Scripts/HotUpdate/Main/UI/UIManager.cs new file mode 100644 index 0000000..43acf1d --- /dev/null +++ b/Assets/Scripts/HotUpdate/Main/UI/UIManager.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using YooAsset; + +public class UIManager : SingletonMono +{ + Transform uiRoot; + Dictionary openedWindows = new Dictionary(); + public void ShowWindow(string windowName,Action onShow = null) where T : UIBaseWindow + { + if (openedWindows.ContainsKey(windowName)) + { + var window = openedWindows[windowName] as T; + window.Show(); + onShow?.Invoke(window); + } + else + { + YooAssets.LoadAssetAsync(windowName).Completed += handle => + { + GameObject go = Instantiate((GameObject)handle.AssetObject, GameManager.Inst.MainUICanvas.transform); + var window = go.GetComponent(); + window.Show(); + onShow?.Invoke(window); + }; + } + } + public void HideWindow(string windowName) + { + if (openedWindows.ContainsKey(windowName)) + { + openedWindows[windowName].Hide(); + } + } +} diff --git a/Assets/Scripts/HotUpdate/Main/UI/UIManager.cs.meta b/Assets/Scripts/HotUpdate/Main/UI/UIManager.cs.meta new file mode 100644 index 0000000..c77bc1c --- /dev/null +++ b/Assets/Scripts/HotUpdate/Main/UI/UIManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 20e218836a1c9e345ae1652efb3f2931 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Runtime/Boot.cs b/Assets/Scripts/Runtime/Boot.cs index 7963cc7..b7be5f3 100644 --- a/Assets/Scripts/Runtime/Boot.cs +++ b/Assets/Scripts/Runtime/Boot.cs @@ -5,7 +5,7 @@ using UnityEngine; using UniFramework.Event; using YooAsset; -public class Boot : Singleton +public class Boot : SingletonMono { public GameObject MainUICanvas; public Camera UICamera; diff --git a/Assets/Scripts/Runtime/Singleton.cs b/Assets/Scripts/Runtime/Singleton.cs index 4d2a26c..2e368fe 100644 --- a/Assets/Scripts/Runtime/Singleton.cs +++ b/Assets/Scripts/Runtime/Singleton.cs @@ -1,24 +1,23 @@ + using UnityEngine; -public class Singleton : MonoBehaviour where T : MonoBehaviour +public class Singleton where T:class,new() { - private static T _instance; - + static T _inst; + static readonly object _lock = new object(); public static T Inst { get { - if (_instance == null) + lock (_lock) { - _instance = FindAnyObjectByType(); - - if (_instance == null) + if(_inst == null) { - GameObject singletonObject = new GameObject(typeof(T).Name); - _instance = singletonObject.AddComponent(); + _inst = new T(); + Debug.Log($"[Singleton] 鍒涘缓 {typeof(T).Name} 瀹炰緥"); } + return _inst; } - return _instance; } } -} \ No newline at end of file +} diff --git a/Assets/Scripts/Runtime/SingletonMono.cs b/Assets/Scripts/Runtime/SingletonMono.cs new file mode 100644 index 0000000..f47f42e --- /dev/null +++ b/Assets/Scripts/Runtime/SingletonMono.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +public class SingletonMono : MonoBehaviour where T : MonoBehaviour +{ + private static T _instance; + private static readonly object _lock = new object(); + public static T Inst + { + get + { + lock (_lock) + { + if (_instance == null) + { + _instance = FindAnyObjectByType(); + + if (_instance == null) + { + GameObject singletonObject = new GameObject(typeof(T).Name); + DontDestroyOnLoad(singletonObject); + _instance = singletonObject.AddComponent(); + Debug.Log($"瀹炰緥鍖杮singletonObject.name}"); + } + } + return _instance; + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Runtime/SingletonMono.cs.meta b/Assets/Scripts/Runtime/SingletonMono.cs.meta new file mode 100644 index 0000000..8d7d46a --- /dev/null +++ b/Assets/Scripts/Runtime/SingletonMono.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 50a00830f8355f345af250090bebff8e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index 7f22b6b..f722bc0 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -9,10 +9,10 @@ EditorUserSettings: value: 550256005d025d58090c082113735e4447164c7b797925672b2f1935e1b6326b flags: 0 RecentlyUsedSceneGuid-1: - value: 5a5757560101590a5d0c0e24427b5d44434e4c7a7b7a23677f2b4565b7b5353a + value: 5300050454035b5f590a0d2341705c441715487929717231297d4a31bab26160 flags: 0 RecentlyUsedSceneGuid-2: - value: 5300050454035b5f590a0d2341705c441715487929717231297d4a31bab26160 + value: 5a5757560101590a5d0c0e24427b5d44434e4c7a7b7a23677f2b4565b7b5353a flags: 0 vcSharedLogLevel: value: 0d5e400f0650 diff --git a/UserSettings/Layouts/default-2022.dwlt b/UserSettings/Layouts/default-2022.dwlt index 05d4aef..18840a3 100644 --- a/UserSettings/Layouts/default-2022.dwlt +++ b/UserSettings/Layouts/default-2022.dwlt @@ -119,7 +119,7 @@ MonoBehaviour: m_MinSize: {x: 300, y: 100} m_MaxSize: {x: 24288, y: 16192} vertical: 0 - controlID: 88 + controlID: 42 draggingID: 0 --- !u!114 &6 MonoBehaviour: @@ -209,7 +209,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 1 m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0} - m_Name: GameView + m_Name: SceneView m_EditorClassIdentifier: m_Children: [] m_Position: @@ -220,7 +220,7 @@ MonoBehaviour: height: 853 m_MinSize: {x: 202, y: 221} m_MaxSize: {x: 4002, y: 4021} - m_ActualView: {fileID: 12} + m_ActualView: {fileID: 14} m_Panes: - {fileID: 14} - {fileID: 12} @@ -229,8 +229,8 @@ MonoBehaviour: - {fileID: 17} - {fileID: 18} - {fileID: 19} - m_Selected: 1 - m_LastSelected: 0 + m_Selected: 0 + m_LastSelected: 1 --- !u!114 &10 MonoBehaviour: m_ObjectHideFlags: 52 @@ -241,7 +241,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 1 m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0} - m_Name: ProjectBrowser + m_Name: ConsoleWindow m_EditorClassIdentifier: m_Children: [] m_Position: @@ -250,16 +250,16 @@ MonoBehaviour: y: 853 width: 1877 height: 446 - m_MinSize: {x: 231, y: 271} - m_MaxSize: {x: 10001, y: 10021} - m_ActualView: {fileID: 20} + m_MinSize: {x: 101, y: 121} + m_MaxSize: {x: 4001, y: 4021} + m_ActualView: {fileID: 23} m_Panes: - {fileID: 20} - {fileID: 21} - {fileID: 22} - {fileID: 23} - m_Selected: 0 - m_LastSelected: 3 + m_Selected: 3 + m_LastSelected: 0 --- !u!114 &11 MonoBehaviour: m_ObjectHideFlags: 52 @@ -279,8 +279,8 @@ MonoBehaviour: y: 0 width: 683 height: 1299 - m_MinSize: {x: 276, y: 121} - m_MaxSize: {x: 4001, y: 4021} + m_MinSize: {x: 275, y: 100} + m_MaxSize: {x: 4000, y: 4000} m_ActualView: {fileID: 24} m_Panes: - {fileID: 24} @@ -355,7 +355,7 @@ MonoBehaviour: m_HSlider: 0 m_VSlider: 0 m_IgnoreScrollWheelUntilClicked: 0 - m_EnableMouseInput: 1 + m_EnableMouseInput: 0 m_EnableSliderZoomHorizontal: 0 m_EnableSliderZoomVertical: 0 m_UniformScale: 1 @@ -427,7 +427,7 @@ MonoBehaviour: scrollPos: {x: 0, y: 0} m_SelectedIDs: m_LastClickedID: 0 - m_ExpandedIDs: b094fffff894ffffde97ffff8ec9ffff6eedffff88eeffff82f5ffff08fbffff86a6000072ae0000 + m_ExpandedIDs: c0faffff m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -842,14 +842,14 @@ MonoBehaviour: m_OverrideSceneCullingMask: 6917529027641081856 m_SceneIsLit: 1 m_SceneLighting: 1 - m_2DMode: 1 + m_2DMode: 0 m_isRotationLocked: 0 m_PlayAudio: 0 m_AudioPlay: 0 m_Position: - m_Target: {x: -0.15164621, y: -1.1396797, z: 115.78405} + m_Target: {x: -0.15002425, y: -0.038645927, z: 83.26582} speed: 2 - m_Value: {x: -0.2894786, y: -1.0637867, z: 106.75397} + m_Value: {x: -0.15002425, y: -0.038645927, z: 83.26582} m_RenderMode: 0 m_CameraMode: drawMode: 0 @@ -877,7 +877,7 @@ MonoBehaviour: m_Size: {x: 1, y: 1} yGrid: m_Fade: - m_Target: 0 + m_Target: 1 speed: 2 m_Value: 1 m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.4} @@ -885,9 +885,9 @@ MonoBehaviour: m_Size: {x: 1, y: 1} zGrid: m_Fade: - m_Target: 1 + m_Target: 0 speed: 2 - m_Value: 1 + m_Value: 0 m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.4} m_Pivot: {x: 0, y: 0, z: 0} m_Size: {x: 1, y: 1} @@ -895,17 +895,17 @@ MonoBehaviour: m_GridAxis: 1 m_gridOpacity: 0.5 m_Rotation: - m_Target: {x: 0, y: 0, z: 0, w: 1} + m_Target: {x: -0.08717229, y: 0.89959055, z: -0.21045254, w: -0.3726226} speed: 2 - m_Value: {x: -0.000000010135608, y: 0.00000012578514, z: -0.000000018235706, w: -1} + m_Value: {x: -0.08717229, y: 0.89959055, z: -0.21045254, w: -0.3726226} m_Size: - m_Target: 3.1849651 + m_Target: 9.245027 speed: 2 - m_Value: 3.0478134 + m_Value: 9.245027 m_Ortho: - m_Target: 1 + m_Target: 0 speed: 2 - m_Value: 1 + m_Value: 0 m_CameraSettings: m_Speed: 0.8805599 m_SpeedNormalized: 0.43999997 @@ -919,7 +919,7 @@ MonoBehaviour: m_FarClip: 10000 m_DynamicClip: 0 m_OcclusionCulling: 0 - m_LastSceneViewRotation: {x: -0.06971626, y: 0.86519414, z: -0.12543157, w: -0.48053786} + m_LastSceneViewRotation: {x: -0.08717229, y: 0.89959055, z: -0.21045254, w: -0.3726226} m_LastSceneViewOrtho: 0 m_ReplacementShader: {fileID: 0} m_ReplacementString: @@ -1146,7 +1146,7 @@ MonoBehaviour: m_SkipHidden: 0 m_SearchArea: 1 m_Folders: - - Assets/Samples/Input System/1.14.2/On-Screen Controls + - Assets m_Globs: [] m_OriginalText: m_ImportLogFlags: 0 @@ -1154,16 +1154,16 @@ MonoBehaviour: m_ViewMode: 1 m_StartGridSize: 16 m_LastFolders: - - Assets/Samples/Input System/1.14.2/On-Screen Controls + - Assets m_LastFoldersGridSize: 16 m_LastProjectPath: C:\UnityProject\BlueArchiveMiniGame m_LockTracker: m_IsLocked: 0 m_FolderTreeState: - scrollPos: {x: 0, y: 0} - m_SelectedIDs: 16ae0000 - m_LastClickedID: 44566 - m_ExpandedIDs: 00000000348100001ea6000020a600002ca600002ea6000030a600003ea6000042a6000012ae000000ca9a3b + scrollPos: {x: 0, y: 79} + m_SelectedIDs: 42810000 + m_LastClickedID: 33090 + m_ExpandedIDs: 00000000428100004481000046810000488100004a8100004c8100004e810000648100006c8100007e81000082810000d295000000ca9a3b m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -1191,7 +1191,7 @@ MonoBehaviour: scrollPos: {x: 0, y: 0} m_SelectedIDs: m_LastClickedID: 0 - m_ExpandedIDs: 0000000034810000 + m_ExpandedIDs: 00000000428100004481000046810000488100004a8100004c8100004e810000 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -1222,18 +1222,18 @@ MonoBehaviour: m_ExpandedInstanceIDs: c6230000068f1200828d00000c8d0000121d050042e40400b2930000c4fa0400ae0e0500f2ef0400682a4200802a42008a17420050a10000ee090500bc130500eccd000032030000bef80000c2a300000000000040f500007a860000647c0600f2b606001cb7060010170100b6290100e8ae00000aae0400447f0000d283000082ae0000 m_RenameOverlay: m_UserAcceptedRename: 0 - m_Name: - m_OriginalName: + m_Name: Singleton + m_OriginalName: Singleton m_EditFieldRect: serializedVersion: 2 x: 0 y: 0 width: 0 height: 0 - m_UserData: 0 + m_UserData: 18846 m_IsWaitingForDelay: 0 m_IsRenaming: 0 - m_OriginalEventType: 11 + m_OriginalEventType: 0 m_IsRenamingFilename: 1 m_ClientGUIView: {fileID: 10} m_CreateAssetUtility: @@ -1408,7 +1408,7 @@ MonoBehaviour: m_OverlaysVisible: 1 m_LockTracker: m_IsLocked: 0 - m_LastSelectedObjectID: 44658 + m_LastSelectedObjectID: 37090 --- !u!114 &23 MonoBehaviour: m_ObjectHideFlags: 52