diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index 4e3c1859..5790e9e2 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -750,7 +750,7 @@ Canvas: m_AdditionalShaderChannelsFlag: 25 m_UpdateRectTransformForStandalone: 0 m_SortingLayerID: 0 - m_SortingOrder: 0 + m_SortingOrder: 500 m_TargetDisplay: 0 --- !u!224 &1269024859 RectTransform: @@ -765,6 +765,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 376402498555991245} + - {fileID: 1764640267} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -939,6 +940,58 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &1764640266 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1764640267} + - component: {fileID: 1764640268} + m_Layer: 0 + m_Name: UIDateCheck + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1764640267 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1764640266} + 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: 888371916723674439} + m_Father: {fileID: 1269024859} + 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 &1764640268 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1764640266} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 718cf7f3f1b16f141ab751a37af8cae1, type: 3} + m_Name: + m_EditorClassIdentifier: + ui: {fileID: 2089839050043354719} + text: {fileID: 4601331229292980818} + btn: {fileID: 7231834583498103603} --- !u!1 &2114935602 GameObject: m_ObjectHideFlags: 0 @@ -1098,6 +1151,40 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7258947687994042621} m_CullTransparentMesh: 1 +--- !u!114 &110887888300473105 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3921544984887548570} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: 436 + m_MinHeight: 43 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 +--- !u!114 &187303085634958717 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2086965462285735655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalFit: 2 + m_VerticalFit: 2 --- !u!224 &376402498555991245 RectTransform: m_ObjectHideFlags: 0 @@ -1118,6 +1205,34 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &457648689321205319 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2086965462285735655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: 436 + m_MinHeight: 183 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 +--- !u!222 &525492089466544073 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5681206649821475691} + m_CullTransparentMesh: 1 --- !u!114 &755439116886819988 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1148,6 +1263,26 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!224 &888371916723674439 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2089839050043354719} + 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: 7622962939547687553} + m_Father: {fileID: 1764640267} + 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: -1920, y: -1080} + m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &902241654539185805 RectTransform: m_ObjectHideFlags: 0 @@ -1189,6 +1324,36 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 238, y: 176} m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1128038912698321512 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7245332692720103295} + 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: 0, g: 0, b: 0, a: 0.5019608} + 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: 0} + 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 &1504961720473882854 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1205,6 +1370,56 @@ MonoBehaviour: CustomComponentName: Icon CustomComment: mComponentName: UnityEngine.UI.Image +--- !u!1 &1671880619992264758 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2521152647019992497} + - component: {fileID: 6681216128200013423} + - component: {fileID: 1813275364079888314} + - component: {fileID: 7231834583498103603} + - component: {fileID: 6180712463440446537} + m_Layer: 5 + m_Name: BtnPrefab + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1813275364079888314 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1671880619992264758} + 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: fa63ae52e51e2064390c2a75c12f664c, 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 &1982103501701676502 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1313,6 +1528,93 @@ MonoBehaviour: optionalScrambleMode: 0 optionalShakeRandomnessMode: 0 optionalString: +--- !u!222 &1988465934601991813 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7245332692720103295} + m_CullTransparentMesh: 1 +--- !u!1 &2086965462285735655 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3877370567018537602} + - component: {fileID: 4239072621578749216} + - component: {fileID: 7937913353350945267} + - component: {fileID: 2814462432456552503} + - component: {fileID: 187303085634958717} + - component: {fileID: 457648689321205319} + m_Layer: 5 + m_Name: Connnet + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &2089839050043354719 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 888371916723674439} + - component: {fileID: 7923541361196308593} + - component: {fileID: 4452057681510801829} + m_Layer: 5 + m_Name: UITipWindow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2521152647019992497 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1671880619992264758} + 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: 6623231731764336771} + m_Father: {fileID: 2655579637452759910} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 128.1478, y: 41.656} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &2655579637452759910 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4656565024652926694} + 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: 2521152647019992497} + m_Father: {fileID: 3877370567018537602} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2802739808984475110 CanvasRenderer: m_ObjectHideFlags: 0 @@ -1321,6 +1623,155 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7740213339686398260} m_CullTransparentMesh: 1 +--- !u!114 &2814462432456552503 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2086965462285735655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 20 + m_Right: 20 + m_Top: 20 + m_Bottom: 0 + m_ChildAlignment: 1 + m_Spacing: 0 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 + m_ChildScaleWidth: 1 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 +--- !u!114 &3325917066968789983 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5681206649821475691} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "\u786E\u5B9A" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 97936a7b3a86809479ac89371e95b079, type: 2} + m_sharedMaterial: {fileID: 168401102475399263, guid: 97936a7b3a86809479ac89371e95b079, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 16 + m_fontSizeBase: 16 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 8192 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!114 &3425016141668694121 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4656565024652926694} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 15 + m_ChildAlignment: 4 + m_Spacing: 22 + m_ChildForceExpandWidth: 0 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 +--- !u!222 &3576997835000597077 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3921544984887548570} + m_CullTransparentMesh: 1 --- !u!1 &3604560447573429497 GameObject: m_ObjectHideFlags: 0 @@ -1350,6 +1801,71 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: cabec804a45ce1941b8c1895f35d2860, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &3841773505581629585 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3921544984887548570} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d51f3a7c41ab0346b49ae50d456bece, type: 3} + m_Name: + m_EditorClassIdentifier: + MarkType: 0 + CustomComponentName: Label + CustomComment: + mComponentName: TMPro.TextMeshProUGUI +--- !u!224 &3877370567018537602 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2086965462285735655} + 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: 6349304297074725759} + - {fileID: 2655579637452759910} + m_Father: {fileID: 7622962939547687553} + 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: 91.49997} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.99999994} +--- !u!1 &3921544984887548570 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6349304297074725759} + - component: {fileID: 3576997835000597077} + - component: {fileID: 4601331229292980818} + - component: {fileID: 110887888300473105} + - component: {fileID: 3841773505581629585} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!222 &4239072621578749216 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2086965462285735655} + m_CullTransparentMesh: 1 --- !u!222 &4329888169046837703 CanvasRenderer: m_ObjectHideFlags: 0 @@ -1358,6 +1874,37 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5754390454264469586} m_CullTransparentMesh: 1 +--- !u!114 &4444983099252657014 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4656565024652926694} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d51f3a7c41ab0346b49ae50d456bece, type: 3} + m_Name: + m_EditorClassIdentifier: + MarkType: 0 + CustomComponentName: BtnContent + CustomComment: + mComponentName: RectTransform +--- !u!114 &4452057681510801829 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2089839050043354719} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cadc477eb7be81c4b899b49b072235bd, type: 3} + m_Name: + m_EditorClassIdentifier: + Label: {fileID: 4601331229292980818} + BtnContent: {fileID: 2655579637452759910} + BtnPrefab: {fileID: 7231834583498103603} --- !u!114 &4467067367704618080 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1374,6 +1921,113 @@ MonoBehaviour: CustomComponentName: Label CustomComment: mComponentName: TMPro.TextMeshProUGUI +--- !u!114 &4601331229292980818 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3921544984887548570} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: "\u662F\u5426\u9000\u51FA\u5F53\u524D\u6A21\u5757\uFF1F" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 97936a7b3a86809479ac89371e95b079, type: 2} + m_sharedMaterial: {fileID: 168401102475399263, guid: 97936a7b3a86809479ac89371e95b079, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 20 + m_fontSizeBase: 20 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &4656565024652926694 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2655579637452759910} + - component: {fileID: 3425016141668694121} + - component: {fileID: 4444983099252657014} + m_Layer: 5 + m_Name: BtnContent + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!224 &5548267066476286416 RectTransform: m_ObjectHideFlags: 0 @@ -1393,6 +2047,24 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 25} m_SizeDelta: {x: 0, y: 50} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &5681206649821475691 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6623231731764336771} + - component: {fileID: 525492089466544073} + - component: {fileID: 3325917066968789983} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &5754390454264469586 GameObject: m_ObjectHideFlags: 0 @@ -1430,6 +2102,68 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!114 &6180712463440446537 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1671880619992264758} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d51f3a7c41ab0346b49ae50d456bece, type: 3} + m_Name: + m_EditorClassIdentifier: + MarkType: 0 + CustomComponentName: BtnPrefab + CustomComment: + mComponentName: UnityEngine.UI.Button +--- !u!224 &6349304297074725759 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3921544984887548570} + 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: 3877370567018537602} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &6623231731764336771 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5681206649821475691} + 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: 2521152647019992497} + 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!222 &6681216128200013423 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1671880619992264758} + m_CullTransparentMesh: 1 --- !u!114 &6979315384717970559 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1468,6 +2202,68 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5773262138564131193} m_CullTransparentMesh: 1 +--- !u!114 &7231834583498103603 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1671880619992264758} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 2 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 21300000, guid: 8c77a2052664d0d4e9be892444deddd1, type: 3} + m_SelectedSprite: {fileID: 21300000, guid: 8c77a2052664d0d4e9be892444deddd1, type: 3} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1813275364079888314} + m_OnClick: + m_PersistentCalls: + m_Calls: [] +--- !u!1 &7245332692720103295 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7622962939547687553} + - component: {fileID: 1988465934601991813} + - component: {fileID: 1128038912698321512} + m_Layer: 5 + m_Name: Mask + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &7258947687994042621 GameObject: m_ObjectHideFlags: 0 @@ -1486,6 +2282,26 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!224 &7622962939547687553 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7245332692720103295} + 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: 3877370567018537602} + m_Father: {fileID: 888371916723674439} + 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 &7740213339686398260 GameObject: m_ObjectHideFlags: 0 @@ -1525,6 +2341,44 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 23.5} m_SizeDelta: {x: 51, y: 51} m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &7923541361196308593 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2089839050043354719} + m_CullTransparentMesh: 1 +--- !u!114 &7937913353350945267 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2086965462285735655} + 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: 003fddd8e0543224fb849ccdbb422cd6, type: 3} + m_Type: 1 + 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 &8704027912026391313 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Editor/FixedMainEditor.cs b/Assets/Scripts/Editor/FixedMainEditor.cs index 44d2fa2c..568d4eee 100644 --- a/Assets/Scripts/Editor/FixedMainEditor.cs +++ b/Assets/Scripts/Editor/FixedMainEditor.cs @@ -1,3 +1,6 @@ +using QFramework; +using System; +using System.IO; using UnityEditor; using UnityEngine; @@ -31,5 +34,26 @@ public class FixedMainEditor Menu.SetChecked("Tools/强制Main场景启动", isFixedMain); return true; } + + + + [MenuItem("Tools/创建时间锁")] + private static void TimerLock() + { + //创建数据资源文件 + //泛型是继承自ScriptableObject的类 + TimerLock asset = ScriptableObject.CreateInstance(); + //前一步创建的资源只是存在内存中,现在要把它保存到本地 + //通过编辑器API,创建一个数据资源文件,第二个参数为资源文件在Assets目录下的路径 + AssetDatabase.CreateAsset(asset, "Assets/TimerLock.asset"); + //保存创建的资源 + AssetDatabase.SaveAssets(); + //刷新界面 + AssetDatabase.Refresh(); + } + + + + } #endif \ No newline at end of file diff --git a/Assets/Scripts/Editor/TimerLock.cs b/Assets/Scripts/Editor/TimerLock.cs new file mode 100644 index 00000000..a7482a9f --- /dev/null +++ b/Assets/Scripts/Editor/TimerLock.cs @@ -0,0 +1,11 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[CreateAssetMenu(fileName = "时间锁", menuName = "创建时间锁/配置文件")] +public class TimerLock : ScriptableObject +{ + [Header("软件有效期")] + public string time; + +} diff --git a/Assets/Scripts/Editor/TimerLock.cs.meta b/Assets/Scripts/Editor/TimerLock.cs.meta new file mode 100644 index 00000000..d412f066 --- /dev/null +++ b/Assets/Scripts/Editor/TimerLock.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3fa014c2238b5a942b96b9f55a3f9841 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/VirtualFPostProcess.cs b/Assets/Scripts/Editor/VirtualFPostProcess.cs index a687e3f0..a6d39e6f 100644 --- a/Assets/Scripts/Editor/VirtualFPostProcess.cs +++ b/Assets/Scripts/Editor/VirtualFPostProcess.cs @@ -29,6 +29,34 @@ public class VirtualFPostProcess : IPostprocessBuildWithReport Debug.LogWarning("未找到数据目录: " + dataFolderPath); } DeletAssetBundle(buildOutputPath); + + // 生成时间锁 + GneratorTimerLock(); + } + + /// + /// 生成时间锁文件 + /// + public void GneratorTimerLock() + { + if (File.Exists(Application.dataPath + "/TimerLock.asset")) + { + string path = "Assets/TimerLock.asset"; + var asset = AssetDatabase.LoadAssetAtPath(path); + if (asset != null) + { + if (string.IsNullOrEmpty(asset.time) == false) + { + //第一次获取获取系统时间 + DateTime currentDateTime = DateTime.Now; + string RecordData = currentDateTime.ToString("yyyy-MM-dd HH:mm:ss"); + string strMerge = asset.time + "|" + RecordData; + EncryptFileCreator.EncryptAndSaveData(strMerge, "Timer.txt"); + } + } + } + + } /// @@ -64,7 +92,7 @@ public class VirtualFPostProcess : IPostprocessBuildWithReport Debug.LogError($"Directory not found: {path}"); } } - else if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.StandaloneWindows|| EditorUserBuildSettings.activeBuildTarget == BuildTarget.StandaloneWindows64) + else if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.StandaloneWindows || EditorUserBuildSettings.activeBuildTarget == BuildTarget.StandaloneWindows64) { string path = Path.Combine(buildOutPutPath, "VirtualFramwork_Data", "StreamingAssets", "AssetBundles"); if (Directory.Exists(path)) @@ -92,7 +120,7 @@ public class VirtualFPostProcess : IPostprocessBuildWithReport Debug.LogError($"Directory not found: {path}"); } } - + } diff --git a/Assets/Scripts/Tools/ZXKLicenses.meta b/Assets/Scripts/Tools/ZXKLicenses.meta new file mode 100644 index 00000000..2dfa7e11 --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4fec87e21a9630c46b1a6ef7dec72ea6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ZXKLicenses/Encryption.meta b/Assets/Scripts/Tools/ZXKLicenses/Encryption.meta new file mode 100644 index 00000000..65aade6d --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Encryption.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bb335401f53d3c94490f449b410da1ba +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs new file mode 100644 index 00000000..97a8c72c --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs @@ -0,0 +1,104 @@ +using System; +using System.IO; +using TMPro; +using UnityEngine; +using UnityEngine.Events; +using UnityEngine.UI; + +public class DateManager : MonoBehaviour +{ + private string EndTimer;//缁撴潫鏃堕棿 + private string RecordData; + public GameObject ui; + public TextMeshProUGUI text; + public Button btn; + private void Awake() + { + ui.gameObject.SetActive(false); + btn.onClick.AddListener(() => + { + Application.Quit(); + }); + UpdateTime(ShowTip, ShowTip); + } + + public void ShowTip(string str) + { + ui.SetActive(true); + text.text = str; + } + + /// + /// 鏇存柊绯荤粺鏃堕棿 + /// + public void UpdateTime(UnityAction error = null, UnityAction timeOut = null, UnityAction updateTimer = null) + { + try + { + string datas = DecryptFileReader.ReadAndDecryptData("Timer.txt"); + EndTimer = datas.Split('|')[0]; + RecordData = datas.Split('|')[1]; + //绗竴娆¤幏鍙栬幏鍙栫郴缁熸椂闂 + DateTime currentDateTime = DateTime.Now; + string Data = currentDateTime.ToString("yyyy-MM-dd HH:mm:ss"); + if (DateTime.TryParse(RecordData, out DateTime recordDateTime) && DateTime.TryParse(Data, out DateTime nowDateTime)) + { + if (recordDateTime > nowDateTime) + { + Debug.Log("浠跨湡鏂囦欢琚崯鍧忥紝璇疯仈绯荤鐞嗗憳杩涜淇"); + error?.Invoke("浠跨湡鏂囦欢琚崯鍧忥紝璇疯仈绯荤鐞嗗憳杩涜淇"); + } + else + { + //鎶婁笂涓娆″瓨鍌ㄥ緱绯荤粺鏃堕棿鏇存柊鍒版渶鏂 + string timer = "Timer.txt"; + RecordData = Data; + string strMerge = EndTimer + "|" + RecordData; + EncryptFileCreator.EncryptAndSaveData(strMerge, timer); + updateTimer?.Invoke(); + } + } + } + catch (Exception e) + { + Debug.LogError($"鏁版嵁鍑洪敊: {e.Message}"); + error?.Invoke($"鏁版嵁鍑洪敊: {e.Message}"); + } + + if (JudgeExpire()) + { + Debug.Log("璇疯仈绯荤鐞嗗憳杩涜鍗囩骇"); + timeOut?.Invoke("璇疯仈绯荤鐞嗗憳杩涜鍗囩骇"); + } + } + + /// + /// 鍒ゆ柇鏄惁鍒版湡 + /// + /// + public bool JudgeExpire() + { + if (DateTime.TryParse(EndTimer, out DateTime endDataTime) && DateTime.TryParse(RecordData, out DateTime recordDateTime)) + { + //缁撴潫鏃ユ湡灏忎簬鐩墠鏃ユ湡浠h〃鍒版湡 + if (endDataTime < recordDateTime) + { + return true; + } + } + return false; + } + + + /// + /// 缁欏鎴锋墦鍖呯殑鏃跺,闇瑕佽缃瓻ndTimer,鐒跺悗杩愯涓娆$敓鎴愭枃浠跺苟娉ㄩ噴鎺 + /// + public void CreatTimer() + { + //绗竴娆¤幏鍙栬幏鍙栫郴缁熸椂闂 + DateTime currentDateTime = DateTime.Now; + RecordData = currentDateTime.ToString("yyyy-MM-dd HH:mm:ss"); + string strMerge = EndTimer + "|" + RecordData; + EncryptFileCreator.EncryptAndSaveData(strMerge, "Timer.txt"); + } +} diff --git a/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs.meta b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs.meta new file mode 100644 index 00000000..604aec1b --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DateManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 718cf7f3f1b16f141ab751a37af8cae1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ZXKLicenses/Encryption/DecryptFileReader.cs b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DecryptFileReader.cs new file mode 100644 index 00000000..9a68c1bb --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DecryptFileReader.cs @@ -0,0 +1,44 @@ +using System.IO; +using System.Security.Cryptography; +using System.Text; +using UnityEngine; + +public class DecryptFileReader +{ + private static byte[] key = Encoding.UTF8.GetBytes("Sixteen byte key"); // 鍔犲瘑瀵嗛挜锛岄渶涓庡姞瀵嗘椂涓鑷 + private static byte[] iv = Encoding.UTF8.GetBytes("InitializationVe"); // 纭繚IV闀垮害涓16瀛楄妭 + + public static string ReadAndDecryptData(string filePath) + { + string fullPath = Path.Combine(Application.streamingAssetsPath, filePath); + if (File.Exists(fullPath) == false) + { + return ""; + } + // 璇诲彇鍔犲瘑鏂囦欢 + byte[] encryptedData = File.ReadAllBytes(fullPath); + + // 鍒涘缓AES瑙e瘑鍣 + using (Aes aesAlg = Aes.Create()) + { + aesAlg.Key = key; + aesAlg.IV = iv; + + ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV); + + // 鍒涘缓鍐呭瓨娴佸拰鍔犲瘑娴 + using (MemoryStream msDecrypt = new MemoryStream(encryptedData)) + { + using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read)) + { + byte[] decryptedBytes = new byte[encryptedData.Length]; + int decryptedByteCount = csDecrypt.Read(decryptedBytes, 0, decryptedBytes.Length); + + // 灏嗚В瀵嗗悗鐨勬暟鎹浆鎹负瀛楃涓 + string decryptedData = Encoding.UTF8.GetString(decryptedBytes, 0, decryptedByteCount); + return decryptedData; + } + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/ZXKLicenses/Encryption/DecryptFileReader.cs.meta b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DecryptFileReader.cs.meta new file mode 100644 index 00000000..a4452c9b --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Encryption/DecryptFileReader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 354bc54210a77764ebad2d49b5e927ba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ZXKLicenses/Encryption/EncryptFileCreator.cs b/Assets/Scripts/Tools/ZXKLicenses/Encryption/EncryptFileCreator.cs new file mode 100644 index 00000000..e19b7f24 --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Encryption/EncryptFileCreator.cs @@ -0,0 +1,56 @@ +using System.IO; +using System.Security.Cryptography; +using System.Text; +using UnityEngine; + +public class EncryptFileCreator +{ + private static byte[] key = Encoding.UTF8.GetBytes("Sixteen byte key"); // 鍔犲瘑瀵嗛挜锛岄渶16瀛楄妭 + private static byte[] iv = Encoding.UTF8.GetBytes("InitializationVe"); // 纭繚IV闀垮害涓16瀛楄妭 + + public static void EncryptAndSaveData(string data,string path) + { + string filePath = Path.Combine(Application.streamingAssetsPath, path); + if (!File.Exists(filePath)) + { + try + { + // 鍒涘缓鏂囦欢 + File.WriteAllText(filePath, ""); + Debug.Log("鏂囦欢宸插垱寤"); + } + catch (IOException e) + { + Debug.LogError($"鍒涘缓鏂囦欢鏃跺嚭閿: {e.Message}"); + } + } + // 灏嗘暟鎹浆鎹负瀛楄妭鏁扮粍 + byte[] plainText = Encoding.UTF8.GetBytes(data); + + // 鍒涘缓AES鍔犲瘑鍣 + using (Aes aesAlg = Aes.Create()) + { + aesAlg.Key = key; + aesAlg.IV = iv; + + ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV); + + // 鍒涘缓鍐呭瓨娴佸拰鍔犲瘑娴 + using (MemoryStream msEncrypt = new MemoryStream()) + { + using (CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write)) + { + csEncrypt.Write(plainText, 0, plainText.Length); + csEncrypt.FlushFinalBlock(); + + // 鑾峰彇鍔犲瘑鍚庣殑鏁版嵁 + byte[] encryptedData = msEncrypt.ToArray(); + + // 淇濆瓨鍔犲瘑鏂囦欢鍒癝treamingAssets鏂囦欢澶 + string fullPath = Path.Combine(Application.streamingAssetsPath, filePath); + File.WriteAllBytes(fullPath, encryptedData); + } + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/ZXKLicenses/Encryption/EncryptFileCreator.cs.meta b/Assets/Scripts/Tools/ZXKLicenses/Encryption/EncryptFileCreator.cs.meta new file mode 100644 index 00000000..77d8e4b9 --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Encryption/EncryptFileCreator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 22f7660ba2e708d4eb33622fe324499b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ZXKLicenses/HttpRestful.cs b/Assets/Scripts/Tools/ZXKLicenses/HttpRestful.cs new file mode 100644 index 00000000..dd538b34 --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/HttpRestful.cs @@ -0,0 +1,73 @@ +using QFramework; +using System; +using System.Collections; +using UnityEngine; +using UnityEngine.Networking; + +public class HttpRestful : MonoSingleton +{ + public void Get(string url, Action actionResult = null) + { + StartCoroutine(_Get(url, actionResult)); + } + + private IEnumerator _Get(string url, Action action) + { + using (UnityWebRequest request = UnityWebRequest.Get(url)) + { + yield return request.SendWebRequest(); + + string resstr = ""; + if (request.isNetworkError || request.isHttpError) + { + resstr = request.error; + } + else + { + resstr = request.downloadHandler.text; + } + + if (action != null) + { + action(request.isHttpError, resstr); + } + } + } + public void Post(string url, string form, Action callBack, string Header = null, string HeaderValue = null, int timeOut = 3) + { + + StartCoroutine(_Post(url, form, callBack, Header, HeaderValue, timeOut)); + } + + public IEnumerator _Post(string url, string form, Action callBack, string Header = null, string HeaderValue = null, int timeOut = 3) + { + //璇锋眰閾炬帴锛屽苟灏唂orm瀵硅薄鍙戦佸埌杩滅▼鏈嶅姟鍣 + using (UnityWebRequest webRequest = UnityWebRequest.Post(url, form, "application/json"))//;charset=utf-8 + { + if (!string.IsNullOrEmpty(Header) && !string.IsNullOrEmpty(HeaderValue)) + { + webRequest.SetRequestHeader(Header, HeaderValue); + } + webRequest.timeout = timeOut * 1000; + yield return webRequest.SendWebRequest(); + if (webRequest.result!= UnityWebRequest.Result.Success) + { + Debug.Log(webRequest.error); + callBack?.Invoke(false, webRequest.downloadHandler); + } + else + { + callBack?.Invoke(true, webRequest.downloadHandler); + } + //if (webRequest.isHttpError || webRequest.isNetworkError) + //{ + // //Debug.LogError("==========="); + // callBack?.Invoke(false, null); + //} + //else + //{ + // callBack?.Invoke(true, webRequest.downloadHandler); + //} + }; + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/ZXKLicenses/HttpRestful.cs.meta b/Assets/Scripts/Tools/ZXKLicenses/HttpRestful.cs.meta new file mode 100644 index 00000000..2fa9020e --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/HttpRestful.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cca16177d7a134a43a4fb3320d5b8fc7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ZXKLicenses/Licence.meta b/Assets/Scripts/Tools/ZXKLicenses/Licence.meta new file mode 100644 index 00000000..a4c0b9c7 --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Licence.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 32677377141e60248a7a2484825ce1d4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenceData.cs b/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenceData.cs new file mode 100644 index 00000000..d84ee2c5 --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenceData.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class LicenceData +{ + public string project_id; + public string user_name; + public string license_code; + public string host_id; + public string duration; //浣跨敤鏃堕暱 + public string sign; +} +public class Datas +{ + public static string Project_id = "7"; + public static string secretKey = "pZNwkYoMRp7MG_O7aGtmA"; + public static string UserName; + public static string Licensecode; + public static string Hostid; + public static int Duration;//鎸佺画鏃堕棿 +} +[Serializable] +public class License +{ + public int id; + public string user_name; + public string license_code; + public int is_authorized; + public string host_id; + public string authorization_at; + public string authorization_end_at; + public string created_at; + public int login_count; + public int duration; + public string last_login; +} + +[Serializable] +public class LicenseValidationResponse +{ + public string status; + public string message; + public License license; +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenceData.cs.meta b/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenceData.cs.meta new file mode 100644 index 00000000..de5c59a7 --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenceData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8f40d10c2dcbad941ac179b38fde96bd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenseManager.cs b/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenseManager.cs new file mode 100644 index 00000000..0246d5db --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenseManager.cs @@ -0,0 +1,180 @@ +using Newtonsoft.Json; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Net.NetworkInformation; +using System.Security.Cryptography; +using System.Text; +using UnityEngine; + +public class LicenseManager : MonoBehaviour +{ + private Dictionary Data = new(); + private LicenseValidationResponse LicenseRes = new LicenseValidationResponse(); + private string Hostid = ""; + + public void Init() + { + Hostid = GetPhysicalAddress(); + Datas.Hostid = Hostid; + } + public LicenceData GetLicenceData(string projectid, string userName, string licensecode, string hostid, int duration) + { + Data.Clear(); + LicenceData licence = new LicenceData(); + licence.project_id = projectid; + licence.user_name = userName; + licence.license_code = licensecode; + licence.host_id = hostid; + licence.duration = duration.ToString(); + if (!Data.ContainsKey("project_id")) + { + Data.Add("project_id", licence.project_id); + } + if (!Data.ContainsKey("user_name")) + { + Data.Add("user_name", licence.user_name); + } + if (!Data.ContainsKey("license_code")) + { + Data.Add("license_code", licence.license_code); + } + if (!Data.ContainsKey("host_id")) + { + Data.Add("host_id", licence.host_id); + } + if (!Data.ContainsKey("duration")) + { + Data.Add("duration", licence.duration); + } + licence.sign = GenerateSignature(Datas.secretKey, Data); + return licence; + } + /// + /// 璇锋眰 + /// + /// + /// + public void LicensePost(Action callBack = null) + { + LicenceData licence = GetLicenceData(Datas.Project_id, Datas.UserName, Datas.Licensecode, Datas.Hostid, Datas.Duration); + + string json = JsonConvert.SerializeObject(licence); + HttpRestful.Instance.Post("https://locallicense.zxkedu.com/api/license/validate/", json, (m, n) => + { + JsonConvert.DeserializeObject(n.text); + if (LicenseRes.status == "success") + { + EncryptedFile(); + } + callBack.Invoke(m); + }); + } + + /// + /// 鐢熸垚瀵嗗寵 + /// + /// + /// + /// + public string GenerateSignature(string secretKey, Dictionary data) + { + // 娣诲姞褰撳墠鏃堕棿鎴 + //string timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString(); + //鑾峰彇褰撳墠鏃堕棿鎴冲苟鍥涜垗浜斿叆鍒版渶杩戠殑鍒嗛挓 + long timestamp = (long)(DateTimeOffset.UtcNow.ToUnixTimeSeconds() / 60) * 60; + //long timestamp = (long)(GetTimestamp() / 60) * 60; + if (!data.ContainsKey("timestamp")) + { + data.Add("timestamp", timestamp.ToString()); + } + else + { + data["timestamp"] = timestamp.ToString(); + } + // 瀵归敭鍊煎杩涜鎺掑簭 + var sortedData = data.OrderBy(kvp => kvp.Key); + Debug.Log("sortedData瀵归敭鍊煎杩涜鎺掑簭:" + sortedData); + + // 鏋勫缓鏌ヨ瀛楃涓 + string queryString = string.Join("&", sortedData.Select(kvp => $"{kvp.Key}={kvp.Value}")); + Debug.Log("queryString鏋勫缓鏌ヨ瀛楃涓:" + queryString); + // 浣跨敤HMAC-SHA256鐢熸垚绛惧悕 + using (var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secretKey))) + { + byte[] hash = hmac.ComputeHash(Encoding.UTF8.GetBytes(queryString)); + Debug.Log("鐢熸垚绛惧悕:" + BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant()); + return BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant(); + } + } + + public void StartSetDuration() + { + if (gameObject.activeSelf) + { + StartCoroutine(SetDuration(60f)); + } + } + + IEnumerator SetDuration(float times) + { + while (true) + { + yield return new WaitForSeconds(times); + Datas.Duration++; + LicensePost(); + Datas.Duration = 0; + } + } + public string GetMachineGuid() + { + if (string.IsNullOrEmpty(Hostid)) + { + NetworkInterface[] nis = NetworkInterface.GetAllNetworkInterfaces(); + foreach (NetworkInterface ni in nis) + { + if (ni.NetworkInterfaceType == NetworkInterfaceType.Wireless80211 || + ni.NetworkInterfaceType == NetworkInterfaceType.Ethernet) + { + Hostid = ni.GetPhysicalAddress().ToString(); + break; + } + } + } + return Hostid; + } + + string GetPhysicalAddress() + { + //string physicalAddress = ""; + //NetworkInterface[] nis = NetworkInterface.GetAllNetworkInterfaces(); + //foreach (NetworkInterface ni in nis) + //{ + // if (ni.NetworkInterfaceType == NetworkInterfaceType.Ethernet && ni.OperationalStatus == OperationalStatus.Up) + // { + // physicalAddress = ni.GetPhysicalAddress().ToString(); + // break; + // } + //} + return SystemInfo.deviceUniqueIdentifier; + } + + /// + /// 鏈湴瀛樺偍Hostid + /// + public void EncryptedFile() + { + string dataToEncrypt = Datas.UserName + "|" + Datas.Licensecode + "|"; + EncryptFileCreator.EncryptAndSaveData(dataToEncrypt, "encryptedData.txt"); + } + /// + /// 璇诲彇Hostid + /// + /// + public string ReadDecryptedFile() + { + string decryptedData = DecryptFileReader.ReadAndDecryptData("encryptedData.txt"); + return decryptedData; + } +} diff --git a/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenseManager.cs.meta b/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenseManager.cs.meta new file mode 100644 index 00000000..b85899a3 --- /dev/null +++ b/Assets/Scripts/Tools/ZXKLicenses/Licence/LicenseManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 13a2f840c2d90a44b8473ca7cf9adef1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: