From 8cf83787cd6c9f53cb18a6f22dae8bcdfc89519b Mon Sep 17 00:00:00 2001 From: wulongxiao <2545507770@qq.com> Date: Fri, 15 Nov 2024 16:09:17 +0800 Subject: [PATCH] add_fish --- meng_yao/Assets/Scenes/scene_jiashadao.unity | 390 +++++++++--------- .../landContorl_jinsha.cs | 4 +- meng_yao/Assets/script/scene_jishadao.meta | 8 + .../script/scene_jishadao/jishadao_buy.cs | 88 ++++ .../scene_jishadao/jishadao_buy.cs.meta | 11 + .../script/scene_jishadao/jishadao_contorl.cs | 385 +++++++++++++++++ .../scene_jishadao/jishadao_contorl.cs.meta | 11 + 7 files changed, 703 insertions(+), 194 deletions(-) create mode 100644 meng_yao/Assets/script/scene_jishadao.meta create mode 100644 meng_yao/Assets/script/scene_jishadao/jishadao_buy.cs create mode 100644 meng_yao/Assets/script/scene_jishadao/jishadao_buy.cs.meta create mode 100644 meng_yao/Assets/script/scene_jishadao/jishadao_contorl.cs create mode 100644 meng_yao/Assets/script/scene_jishadao/jishadao_contorl.cs.meta diff --git a/meng_yao/Assets/Scenes/scene_jiashadao.unity b/meng_yao/Assets/Scenes/scene_jiashadao.unity index 88e005550..1427de3bb 100644 --- a/meng_yao/Assets/Scenes/scene_jiashadao.unity +++ b/meng_yao/Assets/Scenes/scene_jiashadao.unity @@ -281,7 +281,7 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: - - m_Target: {fileID: 510804176} + - m_Target: {fileID: 0} m_TargetAssemblyTypeName: landContorl_jinsha, Assembly-CSharp m_MethodName: OnClick m_Mode: 1 @@ -367,6 +367,86 @@ RectTransform: m_AnchoredPosition: {x: 556, y: 100} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &237864901 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 237864902} + - component: {fileID: 237864904} + - component: {fileID: 237864903} + m_Layer: 5 + m_Name: Text (Legacy) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &237864902 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 237864901} + 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: 737419713} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 21.143219, y: 0} + m_SizeDelta: {x: -64.34909, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &237864903 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 237864901} + 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: 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_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 30 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 3 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: "10\uFF1A00" +--- !u!222 &237864904 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 237864901} + m_CullTransparentMesh: 1 --- !u!1 &264538203 GameObject: m_ObjectHideFlags: 0 @@ -548,6 +628,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1265030038} + - {fileID: 737419713} - {fileID: 1071194271} m_Father: {fileID: 1432362433} m_RootOrder: 2 @@ -777,7 +858,6 @@ RectTransform: m_LocalScale: {x: 0.75, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 1366994064} - {fileID: 458252228} m_Father: {fileID: 2131270351} m_RootOrder: 1 @@ -856,12 +936,12 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 414794657} - m_RootOrder: 1 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 27.2437, y: 0} - m_SizeDelta: {x: -71.5126, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &458252229 MonoBehaviour: @@ -914,7 +994,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 510804175} - - component: {fileID: 510804176} + - component: {fileID: 510804177} m_Layer: 5 m_Name: top1 m_TagString: Untagged @@ -943,7 +1023,7 @@ RectTransform: m_AnchoredPosition: {x: 540, y: -960} m_SizeDelta: {x: 1080, y: 1920} m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &510804176 +--- !u!114 &510804177 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -952,10 +1032,10 @@ MonoBehaviour: m_GameObject: {fileID: 510804174} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: e14236262b3cead4597580fdb841652f, type: 3} + m_Script: {fileID: 11500000, guid: 195502a56cff5614c989db7fabdb604d, type: 3} m_Name: m_EditorClassIdentifier: - fishManPrefab: {fileID: 9027535534103199909, guid: 930941387799a9d479889a373bafdc8e, type: 3} + fishManPrefab: {fileID: 250013124275613388, guid: 6f83d74a5434cca478809c01980c861a, type: 3} listItem: [] startPos: {fileID: 2026870705} endPos: {fileID: 56576995} @@ -970,10 +1050,10 @@ MonoBehaviour: pathsNeedTimer: 30 fishingNeedTimer: 30 restTimer: 5 - goldNumerTextPro: {fileID: 0} - shipNumberTextPro: {fileID: 0} + goldNumerTextPro: {fileID: 237864903} + shipNumberTextPro: {fileID: 790339164} HightLight: {fileID: 359301738} - OnBtnAni: {fileID: 2072244184} + OnBtnAni: {fileID: 909562577} FishPrice: 0 map: {fileID: 0} ids: [] @@ -1014,7 +1094,7 @@ RectTransform: m_AnchoredPosition: {x: -11, y: -8} m_SizeDelta: {x: 1080, y: 1920} m_Pivot: {x: 0.5, y: 0.5} ---- !u!1 &618846802 +--- !u!1 &685492251 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1022,9 +1102,9 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 618846803} - - component: {fileID: 618846805} - - component: {fileID: 618846804} + - component: {fileID: 685492252} + - component: {fileID: 685492254} + - component: {fileID: 685492253} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -1032,33 +1112,33 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &618846803 +--- !u!224 &685492252 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 618846802} + m_GameObject: {fileID: 685492251} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1.34, y: 1, z: 1} + m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 1947858898} + m_Father: {fileID: 737419713} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0.5} - m_AnchorMax: {x: 0, y: 0.5} - m_AnchoredPosition: {x: 40, y: -2} - m_SizeDelta: {x: 46, y: 48} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -63.3, y: -1.8} + m_SizeDelta: {x: 53.6977, y: 43.218} m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &618846804 +--- !u!114 &685492253 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 618846802} + m_GameObject: {fileID: 685492251} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} @@ -1074,7 +1154,7 @@ MonoBehaviour: m_Calls: [] m_Sprite: {fileID: 21300000, guid: 6a0a2f486c805cd4883694ffa531db75, type: 3} m_Type: 0 - m_PreserveAspect: 1 + m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 m_FillAmount: 1 @@ -1082,13 +1162,13 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 ---- !u!222 &618846805 +--- !u!222 &685492254 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 618846802} + m_GameObject: {fileID: 685492251} m_CullTransparentMesh: 1 --- !u!1 &718864463 GameObject: @@ -1128,6 +1208,84 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &737419712 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 737419713} + - component: {fileID: 737419715} + - component: {fileID: 737419714} + m_Layer: 5 + m_Name: goldnumber + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &737419713 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 737419712} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.75, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 685492252} + - {fileID: 237864902} + m_Father: {fileID: 307679580} + m_RootOrder: 1 + 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: 274, y: 166.1} + m_SizeDelta: {x: 190, y: 42} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &737419714 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 737419712} + 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: 4319f8a1771ef154db3f5b49657b9d57, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &737419715 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 737419712} + m_CullTransparentMesh: 1 --- !u!1 &767448254 GameObject: m_ObjectHideFlags: 0 @@ -1318,12 +1476,12 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1071194271} - m_RootOrder: 1 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 27.2437, y: 0} - m_SizeDelta: {x: -71.5126, y: 0} + m_AnchoredPosition: {x: 21.1433, y: 0} + m_SizeDelta: {x: -64.3491, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &790339164 MonoBehaviour: @@ -1483,7 +1641,7 @@ MonoBehaviour: m_GameObject: {fileID: 813379039} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a24cdfad8fc45d94dbc2008e72816ca9, type: 3} + m_Script: {fileID: 11500000, guid: 1fd2834c8d741d4419383839473af41c, type: 3} m_Name: m_EditorClassIdentifier: iconS: @@ -1979,14 +2137,13 @@ RectTransform: m_LocalScale: {x: 0.75, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 1175891414} - {fileID: 790339163} m_Father: {fileID: 307679580} - m_RootOrder: 1 + m_RootOrder: 2 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: 274, y: 160} + m_AnchoredPosition: {x: 274, y: 121.2} m_SizeDelta: {x: 190, y: 42} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1071194272 @@ -2208,7 +2365,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2013356390253994791, guid: 44f8c7a70b8d4c54983e81548e983557, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName - value: JinBiDao_buy, Assembly-CSharp + value: jishadao_buy, Assembly-CSharp objectReference: {fileID: 0} - target: {fileID: 2013356390253994791, guid: 44f8c7a70b8d4c54983e81548e983557, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName @@ -2313,82 +2470,6 @@ RectTransform: m_CorrespondingSourceObject: {fileID: 6720542061045396415, guid: 44f8c7a70b8d4c54983e81548e983557, type: 3} m_PrefabInstance: {fileID: 1164482148} m_PrefabAsset: {fileID: 0} ---- !u!1 &1175891413 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1175891414} - - component: {fileID: 1175891416} - - component: {fileID: 1175891415} - m_Layer: 5 - m_Name: Image - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1175891414 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1175891413} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1.34, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 1071194271} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0.5} - m_AnchorMax: {x: 0, y: 0.5} - m_AnchoredPosition: {x: 40, y: -2} - m_SizeDelta: {x: 46, y: 48} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1175891415 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1175891413} - 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: 4f6efdfe472fa1f43ac395c3ad912739, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!222 &1175891416 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1175891413} - m_CullTransparentMesh: 1 --- !u!1001 &1190715496 PrefabInstance: m_ObjectHideFlags: 0 @@ -3209,82 +3290,6 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!1 &1366994063 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1366994064} - - component: {fileID: 1366994066} - - component: {fileID: 1366994065} - m_Layer: 5 - m_Name: Image - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1366994064 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1366994063} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1.34, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 414794657} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0.5} - m_AnchorMax: {x: 0, y: 0.5} - m_AnchoredPosition: {x: 40, y: -2} - m_SizeDelta: {x: 46, y: 48} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1366994065 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1366994063} - 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: 6a0a2f486c805cd4883694ffa531db75, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!222 &1366994066 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1366994063} - m_CullTransparentMesh: 1 --- !u!1 &1407203759 GameObject: m_ObjectHideFlags: 0 @@ -4075,12 +4080,12 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1947858898} - m_RootOrder: 1 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 27.2437, y: 0} - m_SizeDelta: {x: -71.5126, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1924453137 MonoBehaviour: @@ -4308,7 +4313,6 @@ RectTransform: m_LocalScale: {x: 0.75, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 618846803} - {fileID: 1924453136} m_Father: {fileID: 718864464} m_RootOrder: 1 diff --git a/meng_yao/Assets/script/cultivation_gold_gold_Island/landContorl_jinsha.cs b/meng_yao/Assets/script/cultivation_gold_gold_Island/landContorl_jinsha.cs index 6472893a1..fffa11407 100644 --- a/meng_yao/Assets/script/cultivation_gold_gold_Island/landContorl_jinsha.cs +++ b/meng_yao/Assets/script/cultivation_gold_gold_Island/landContorl_jinsha.cs @@ -341,11 +341,13 @@ public class landContorl_jinsha : MonoBehaviour { if (startpos.x > endpos.x) { + Debug.Log("朝向右边"); fishMan.GetComponent().ChangeLookat(0f); // 朝向右边 } else { - fishMan.GetComponent().ChangeLookat(180f); // 朝向左边 + Debug.Log("朝向右边"); + fishMan.GetComponent().ChangeLookat(180f); // 朝向左边 } } diff --git a/meng_yao/Assets/script/scene_jishadao.meta b/meng_yao/Assets/script/scene_jishadao.meta new file mode 100644 index 000000000..416efead4 --- /dev/null +++ b/meng_yao/Assets/script/scene_jishadao.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4578adbb217e08541b84932f3995fb75 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/meng_yao/Assets/script/scene_jishadao/jishadao_buy.cs b/meng_yao/Assets/script/scene_jishadao/jishadao_buy.cs new file mode 100644 index 000000000..c7c010198 --- /dev/null +++ b/meng_yao/Assets/script/scene_jishadao/jishadao_buy.cs @@ -0,0 +1,88 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class jishadao_buy :mount +{ + public static jishadao_buy instance; + public delegate void OnClikeWT(int type, int num); + public event OnClikeWT OnType;//点击事件 + + public List iconS; + + public List lands = new List(); + + public bool Generate1 = false; + public bool Generate2 = false; + public bool Generate3 = false; + public override void Awake() + { + instance = this; + } + + public async void buy_ship() + { + // Cinemachine_2dCon.SetCameraContorl(false); + //Debug.LogError("禁用生成船只逻辑"); + jishadao_contorl.canClick = false; + List boxTypes = new List(); + int index = 1; + for (int i = 0; i < 3; i++) + { + boxTypes.Add(new BoxType { Name = index.ToString() + "文本", prompt = "第" + ArabicToChineseNumberConverter.ConvertToChineseNumbers(index.ToString()) + "层", Type = 4, is_required = true }); + boxTypes.Add(new BoxType { Name = "捕鱼" + index.ToString(), prompt = "捕鱼" + 1, Type = 3, goldNumerobj = (200 * index).ToString(), icon = iconS[index - 1] }); + index++; + } + + GameObject gameObject = add_pop_up(); + gameObject.GetComponent().minHeight = 800;//设置最低高度 + gameObject.GetComponent().setScrollMode(1);//设置滚动模式为滚动 + //gameObject.GetComponent().setScrollMode(0);//设置滚动模式为自动填充 + List gameObjects = gameObject.GetComponent().updateUI(boxTypes, "购买人才");//测试输入框回调处理 + + gameObject.GetComponent().OnEnd += () => + { + //关闭摄像头逻辑 + // Cinemachine_2dCon.SetCameraContorl(true); + jishadao_contorl.canClick = true; + }; + + gameObjects[1].GetComponent().register_click(async (BoxType boxType, int type) =>//登录确定或取消 + { + if (type == 1) + { + if (!Generate1 && (PlayerManager.Instance.Coins - 200) > 0) + { + lands[0].GetComponent().OnClick(); + PlayerManager.Instance.SetMoney(MoneyType.Coins, -200); + } + } + + }); + gameObjects[3].GetComponent().register_click(async (BoxType boxType, int type) =>//登录确定或取消 + { + if (type == 1) + { + if (!Generate1 && (PlayerManager.Instance.Coins - 400) > 0) + { + lands[1].GetComponent().OnClick(); + PlayerManager.Instance.SetMoney(MoneyType.Coins, -400); + } + } + + }); + gameObjects[5].GetComponent().register_click(async (BoxType boxType, int type) =>//登录确定或取消 + { + if (type == 1) + { + if (!Generate1 && (PlayerManager.Instance.Coins - 600) > 0) + { + lands[2].GetComponent().OnClick(); + PlayerManager.Instance.SetMoney(MoneyType.Coins, -600); + } + } + + }); + + } +} diff --git a/meng_yao/Assets/script/scene_jishadao/jishadao_buy.cs.meta b/meng_yao/Assets/script/scene_jishadao/jishadao_buy.cs.meta new file mode 100644 index 000000000..4d75f121d --- /dev/null +++ b/meng_yao/Assets/script/scene_jishadao/jishadao_buy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1fd2834c8d741d4419383839473af41c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/meng_yao/Assets/script/scene_jishadao/jishadao_contorl.cs b/meng_yao/Assets/script/scene_jishadao/jishadao_contorl.cs new file mode 100644 index 000000000..9c39153a2 --- /dev/null +++ b/meng_yao/Assets/script/scene_jishadao/jishadao_contorl.cs @@ -0,0 +1,385 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +using DG.Tweening; +using TMPro; + +public class jishadao_contorl : MonoBehaviour +{ + [Header("渔船的预制体")] + public GameObject fishManPrefab; + [Header("购买的渔船数据")] + public List listItem = new List(); + private GameObject fishMan;//生成的渔船 + private shipcontorl fishManShipContorl;//渔船的控制器 + + [Header("渔船生成点")] + public Transform startPos; + [Header("渔船终点")] + public Transform endPos; + + [Header("岛屿类型编号")] + public int type; + + + + public float ActivateValue = 0; + public int Num = 0; + public int Type = 0; + + [Header("渔船航行路径点集合")] + public List paths; + //航行时间 + [Header("航行时间")] + public float pathsNeedTimer = 30f; + //捕鱼时间 + [Header("捕鱼时间")] + public float fishingNeedTimer = 30f; + //休息时间 + [Header("休息时间")] + public float restTimer = 5f; + + + [Header("显示金币数量")] + public Text goldNumerTextPro; + [Header("显示船只数量")] + public Text shipNumberTextPro; + + + [Header("点击的高亮图层")] + public GameObject HightLight;//高亮图层 + + [Header("点击按钮出现的动画")] + public Transform OnBtnAni; + + public float FishPrice; + + public GameObject map; + + + public static bool canClick = true; + + public List ids = new List(); + + // Start is called before the first frame update + private void Awake() + { + listItem = new List(); + UpdateShipNumberTextPro(listItem.Count.ToString()); + } + private void Start() + { + FishPrice = 10; + + + HightLight.SetActive(false); + + shopman.instance.OnType += addman; + + + } + private void Update() + { + goldNumerTextPro.text = ActivateValue.ToString(); + } + + private void OnDisable() + { + // if (!isGoldLand) return; + shopman.instance.OnType -= addman; + } + + async void addman(int type, int number) + { + if (type == this.type) + { + GenerateForFisherElf generateForFisherElf = new GenerateForFisherElf(); // 购买渔夫 + generateForFisherElf.Num = Num; + generateForFisherElf.Count = 1; + string userponse = await web.SendRequest(web.URL + "/Voucher/GenerateForFisherElf", "POST", JsonUtility.ToJson(generateForFisherElf)); + ids itemList = JsonUtility.FromJson(userponse); + Debug.Log(itemList.Ids[0]); + if (itemList.ErrorCode == 0) // 如果购买成功 + { + Promptmgr.Instance.PromptBubble("购买成功", Color.black, Color.blue); + + /* foreach (string item in itemList.Ids) + { + Use use = new Use(); // 使用渔夫 + use.Id = item; + string rect = await web.SendRequest(web.URL + "/Voucher/Use", "POST", JsonUtility.ToJson(use)); + Res res = JsonUtility.FromJson(userponse); + if (res.ErrorCode == 0) + { + + Promptmgr.Instance.PromptBubble("购买成功", Color.black, Color.blue); + //增加船只数量 + //ChangeShipNumber(1); + + + } + else + { + Promptmgr.Instance.PromptBubble(res.ErrorMessage, Color.black, Color.red); + } + }*/ + + } + else// 如果购买失败 + { + Res res = JsonUtility.FromJson(userponse); + Promptmgr.Instance.PromptBubble(res.ErrorMessage, Color.black, Color.red); + } + } + } + + + private void OnTouch() + { + //OnClick(); + } + + public void OnClick() + { + + Debug.Log("进入生成点击事件"); + /*if (!canClick) + { + return; + }*/ + + + if (fishMan != null) + { + Promptmgr.Instance.PromptBubble("已经有船了", Color.black, Color.red); + + return; + } + + Debug.Log("进入买船"); + + + ScaleAni(OnBtnAni); + add_fish(); + + } + public void add_fish(string timerStr = null)//生成船只 + { + + if (fishMan != null) + { + fishManShipContorl.UpShowTimer(timerStr); + return; + } + + if (timerStr != null) + { + fishMan = GameObject.Instantiate(fishManPrefab, this.transform); + fishMan.transform.position = endPos.position; + fishManShipContorl = fishMan.GetComponent(); + + fishManShipContorl.UpShowTimer(timerStr); + StartCoroutine(Fishing()); + + return; + } + + + // UseShip(); + + fishMan = GameObject.Instantiate(fishManPrefab, this.transform); + fishMan.transform.position = startPos.position; + fishManShipContorl = fishMan.GetComponent(); + + + MoveToFishingPos(); + } + void MoveToFishingPos() + { + + // 随机选择一条路径 + Path selectedPath = paths[Random.Range(0, paths.Count)]; + // 移动到捕鱼点 + StartCoroutine(MoveToFishingPoint(fishMan, selectedPath.pathPoints)); + } + + public void ScaleAni(Transform transform) + { + HightLight.SetActive(true); + transform.DOScale(1.1f, 0.2f) + .SetEase(Ease.InOutSine) + .OnComplete(() => { + transform.DOScale(1f, 0.2f).SetEase(Ease.InOutSine); + HightLight.SetActive(false); + }); + + } + + IEnumerator MoveToFishingPoint(GameObject man, List path) + { + // 将路径点转换为 Vector3 数组 + Vector3[] pathPoints = new Vector3[path.Count]; + for (int i = 0; i < path.Count; i++) + { + pathPoints[i] = path[i].position; + } + + + ChangeShipLook(pathPoints[0], pathPoints[path.Count - 1]); + + // 创建一个摆动效果的 Tween + //注意 ,摆动动的是船,移动移动是根节点 + var swayTween = fishManShipContorl.Man.transform.DOLocalRotate(new Vector3(0, 0, 10), 1f, RotateMode.LocalAxisAdd) // 每次摆动角度 + .SetEase(Ease.InOutSine) + .SetLoops(-1, LoopType.Yoyo); // 无限往复 + + man.GetComponent().SetState(ShipState.move); + + // 使用 DOPath 沿着路径移动到捕鱼点,并禁用旋转变化 + yield return man.transform.DOPath(pathPoints, pathsNeedTimer, PathType.CatmullRom) + .SetOptions(false) // 禁用旋转 + .SetEase(Ease.InOutSine) + .WaitForCompletion(); + + // 停止摆动效果 + swayTween.Kill(); + + StartCoroutine(Fishing()); + + } + + IEnumerator Fishing() + { + // 创建一个摆动效果的 Tween + //注意 ,摆动动的是船,移动移动是根节点 + var swayTween = fishManShipContorl.Man.transform.DOLocalRotate(new Vector3(0, 0, 10), 1f, RotateMode.LocalAxisAdd) // 每次摆动角度 + .SetEase(Ease.InOutSine) + .SetLoops(-1, LoopType.Yoyo); // 无限往复 + + + fishMan.GetComponent().SetState(ShipState.shipthrow); + + + + yield return new WaitForSeconds(1f); + fishMan.GetComponent().SetState(ShipState.stand); + // 等待捕鱼指定时间 + yield return new WaitForSeconds(fishingNeedTimer - 1f); + + + // 停止摆动效果 + // swayTween.Kill(); + // 返回起点 + //MoveToStartPos(); + } + + + void MoveToStartPos() + { + + + // 随机选择一条路径 + Path selectedPath = paths[Random.Range(0, paths.Count)]; + // 移动到点 + StartCoroutine(MoveToStartPos(fishMan, selectedPath.pathPoints)); + } + + + + IEnumerator MoveToStartPos(GameObject man, List path) + { + + // 创建路径点数组,长度为路径点数量 + 1 + Vector3[] pathPoints = new Vector3[path.Count + 1]; + + // 设置最后一个点为起始位置 + pathPoints[path.Count] = startPos.position; + + // 反向赋值路径点 + for (int i = 0; i < path.Count; i++) + { + pathPoints[i] = path[path.Count - 1 - i].position; // 从最后一个点开始赋值 + } + + + ChangeShipLook(pathPoints[0], pathPoints[path.Count]); + + // 创建一个摆动效果的 Tween + //注意 ,摆动动的是船,移动移动是根节点 + var swayTween = fishManShipContorl.Man.transform.DOLocalRotate(new Vector3(0, 0, 10), 1f, RotateMode.LocalAxisAdd) // 每次摆动角度 + .SetEase(Ease.InOutSine) + .SetLoops(-1, LoopType.Yoyo); // 无限往复 + + + + + man.GetComponent().SetState(ShipState.move); + + // 使用 DOPath 沿着路径移动到捕鱼点,并禁用旋转变化 + yield return man.transform.DOPath(pathPoints, pathsNeedTimer, PathType.CatmullRom) + .SetOptions(false) // 禁用旋转 + .SetEase(Ease.InOutSine) + .WaitForCompletion(); + + //加钱 + //AddGold(); + + // 等待捕鱼指定时间 + yield return new WaitForSeconds(restTimer); + + + + // 停止摆动效果 + swayTween.Kill(); + + //循环 + MoveToFishingPos(); + } + + //根据前后位置改变朝向 + void ChangeShipLook(Vector3 startpos, Vector3 endpos) + { + if (startpos.x > endpos.x) + { + Debug.Log("朝向右边"); + fishMan.GetComponent().ChangeLookat(0f); // 朝向右边 + } + else + { + Debug.Log("朝向右边"); + fishMan.GetComponent().ChangeLookat(180f); // 朝向左边 + } + + } + + + //更新船只数量显示 + public void UpdateShipNumberTextPro(string str) + { + if (shipNumberTextPro.text == str) + { + return; + } + shipNumberTextPro.text = str; + + } + + + //使用代金卷 + async void UseShip() + { + Use use = new Use(); // 使用渔夫 + use.Id = listItem[0].Id; + string rect = await web.SendRequest(web.URL + "/Voucher/Use", "POST", JsonUtility.ToJson(use)); + Res res = JsonUtility.FromJson(rect); + if (res.ErrorCode == 0) + { + Promptmgr.Instance.PromptBubble("使用成功", Color.black, Color.blue); + } + else + { + Promptmgr.Instance.PromptBubble(res.ErrorMessage, Color.black, Color.red); + } + } +} diff --git a/meng_yao/Assets/script/scene_jishadao/jishadao_contorl.cs.meta b/meng_yao/Assets/script/scene_jishadao/jishadao_contorl.cs.meta new file mode 100644 index 000000000..d074eddba --- /dev/null +++ b/meng_yao/Assets/script/scene_jishadao/jishadao_contorl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 195502a56cff5614c989db7fabdb604d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: