From fafb3a3ba696b801f0c87b6165a658f947036267 Mon Sep 17 00:00:00 2001 From: hyskai <2545507770@qq.com> Date: Sat, 2 Nov 2024 23:24:42 +0800 Subject: [PATCH 1/3] add --- meng_yao/Assets/script/Panel/AssestPanel.cs | 2 +- .../cultivation_gold_coin_Island/boy.cs | 17 +++++---- .../landContorl.cs | 37 +++++++++++++------ .../shipcontorl.cs | 14 +++---- 4 files changed, 44 insertions(+), 26 deletions(-) diff --git a/meng_yao/Assets/script/Panel/AssestPanel.cs b/meng_yao/Assets/script/Panel/AssestPanel.cs index 45dc4299c..7632ffe82 100644 --- a/meng_yao/Assets/script/Panel/AssestPanel.cs +++ b/meng_yao/Assets/script/Panel/AssestPanel.cs @@ -26,7 +26,7 @@ public class AssestPanel : MonoBehaviour async void ExecuteTask() { - string userponse = await web.SendRequest(web.URL + "/Player/GetInfo", "POST"); + string userponse = await web.SendRequest(web.URL + "/Player/GetInfo", "POST"); infopyler res = JsonUtility.FromJson(userponse); SetCoinText(res.Info.Gold); SetStoneText(res.Info.Gem); diff --git a/meng_yao/Assets/script/cultivation_gold_coin_Island/boy.cs b/meng_yao/Assets/script/cultivation_gold_coin_Island/boy.cs index 76697af70..793510577 100644 --- a/meng_yao/Assets/script/cultivation_gold_coin_Island/boy.cs +++ b/meng_yao/Assets/script/cultivation_gold_coin_Island/boy.cs @@ -42,12 +42,11 @@ public class boy : mount } else//宝石 { - allfisherman = await web.SendRequest(web.URL + "/FisherElfActive/GetListOfGem", "POST"); - - } - Debug.Log(allfisherman); + allfisherman = await web.SendRequest(web.URL + "/FisherElfActive/GetListOfGem", "POST"); + } + //Debug.Log(allfisherman); Response allfishermanres = JsonUtility.FromJson(allfisherman); - Debug.Log(Struct.StructToString(allfishermanres, 1)); + //Debug.Log(Struct.StructToString(allfishermanres, 1)); foreach (Item item in allfishermanres.List) { if (item.Type == currencType) @@ -57,7 +56,7 @@ public class boy : mount if (gameObject.GetComponent().ActivateValue == item.ActivateValue)//如果价格一致 { Debug.Log(item.RemainEndureTime.ToString() +'/' + item.EndureTime.ToString()); - gameObject.GetComponent().add_fish(); + gameObject.GetComponent().add_fish(item.RemainEndureTime.ToString() + '/' + item.EndureTime.ToString()); } } } @@ -65,6 +64,10 @@ public class boy : mount } - //Debug.Log(Struct.StructToString(ActivateValues.Keys, 1)); + //Debug.Log(Struct.StructToString(ActivateValues.Values, 1)); } + + + + } diff --git a/meng_yao/Assets/script/cultivation_gold_coin_Island/landContorl.cs b/meng_yao/Assets/script/cultivation_gold_coin_Island/landContorl.cs index 1a8159f5d..e714e3bfb 100644 --- a/meng_yao/Assets/script/cultivation_gold_coin_Island/landContorl.cs +++ b/meng_yao/Assets/script/cultivation_gold_coin_Island/landContorl.cs @@ -98,10 +98,22 @@ public class landContorl : MonoBehaviour private void OnMouseDown() { + if (fishMan != null) + { + Promptmgr.Instance.PromptBubble("已经有船了", Color.black, Color.red); + return; + } + OnClick(); } private void OnTouch() { + if (fishMan != null) + { + Promptmgr.Instance.PromptBubble("已经有船了", Color.black, Color.red); + return; + } + OnClick(); } @@ -140,9 +152,15 @@ public class landContorl : MonoBehaviour Debug.Log(Struct.StructToString(itemList, 3)); } - public void add_fish()//生成船只 + public void add_fish(string timerStr=null)//生成船只 { - + //倒计时 + // fishManShipContorl.UpShowTimer("测试"); + if (fishMan!=null) + { + fishManShipContorl.UpShowTimer(timerStr); + return; + } fishMan = GameObject.Instantiate(fishManPrefab); fishMan.transform.position = startPos.position; @@ -151,10 +169,8 @@ public class landContorl : MonoBehaviour MoveToFishingPos(); } void MoveToFishingPos() - { + { - //倒计时 - fishManShipContorl.UpShowTimer(pathsNeedTimer); // 随机选择一条路径 Path selectedPath = paths[Random.Range(0, paths.Count)]; // 移动到捕鱼点 @@ -210,8 +226,9 @@ public class landContorl : MonoBehaviour { fishMan.GetComponent().SetState(ShipState.shipthrow); - //倒计时 - fishManShipContorl.UpShowTimer(fishingNeedTimer); + + + yield return new WaitForSeconds(1f); fishMan.GetComponent().SetState(ShipState.stand); // 等待捕鱼指定时间 @@ -224,8 +241,7 @@ public class landContorl : MonoBehaviour void MoveToStartPos() { - //倒计时 - fishManShipContorl.UpShowTimer(pathsNeedTimer); + // 随机选择一条路径 Path selectedPath = paths[Random.Range(0, paths.Count)]; @@ -273,9 +289,8 @@ public class landContorl : MonoBehaviour //加钱 AddGold(); + - //倒计时 - fishManShipContorl.UpShowTimer(restTimer); // 等待捕鱼指定时间 yield return new WaitForSeconds(restTimer); diff --git a/meng_yao/Assets/script/cultivation_gold_coin_Island/shipcontorl.cs b/meng_yao/Assets/script/cultivation_gold_coin_Island/shipcontorl.cs index 44b24d47a..5981948bf 100644 --- a/meng_yao/Assets/script/cultivation_gold_coin_Island/shipcontorl.cs +++ b/meng_yao/Assets/script/cultivation_gold_coin_Island/shipcontorl.cs @@ -50,13 +50,13 @@ public class shipcontorl : MonoBehaviour } - public void UpShowTimer(float timer) + public void UpShowTimer(string info) { - this.timer = timer; - StartCoroutine(UpShowTimerIE()); + //TimerTextPro.text = FloatToTimer(this.timer); + TimerTextPro.text = info; } - IEnumerator UpShowTimerIE() + /* IEnumerator UpShowTimerIE() { while (this.timer>0) { @@ -66,9 +66,9 @@ public class shipcontorl : MonoBehaviour } // 最后显示 00:00 TimerTextPro.text = "00:00"; - } + }*/ - string FloatToTimer(float timer) + /* string FloatToTimer(float timer) { if (timer < 60) { @@ -82,5 +82,5 @@ public class shipcontorl : MonoBehaviour } return null; - } + }*/ } From 3d45e6b4396242423b644668b06aa38f5ac22771 Mon Sep 17 00:00:00 2001 From: hyskai <2545507770@qq.com> Date: Sat, 2 Nov 2024 23:44:59 +0800 Subject: [PATCH 2/3] add --- .../cultivation_gem_island_slices.unity | 110 ++++++++++++++++-- .../landContorl.cs | 11 ++ 2 files changed, 109 insertions(+), 12 deletions(-) diff --git a/meng_yao/Assets/Scenes/cultivation_gem_island_slices.unity b/meng_yao/Assets/Scenes/cultivation_gem_island_slices.unity index 1bb7cf34b..f49fabc96 100644 --- a/meng_yao/Assets/Scenes/cultivation_gem_island_slices.unity +++ b/meng_yao/Assets/Scenes/cultivation_gem_island_slices.unity @@ -710,6 +710,7 @@ MonoBehaviour: isGoldLand: 0 ActivateValue: 0 Num: 0 + Type: 0 paths: - pathPoints: - {fileID: 6047004} @@ -732,7 +733,6 @@ MonoBehaviour: restTimer: 5 getgoldnumber: 100 goldshop: {fileID: 1621691472} - goldnumer: 0 goldNumerTextPro: {fileID: 1113669198} HightLight: {fileID: 998933731} Btntrans: {fileID: 56346249} @@ -1417,7 +1417,7 @@ Transform: - {fileID: 1174175337} - {fileID: 1646946173} m_Father: {fileID: 1343167264} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &310426478 GameObject: @@ -1543,7 +1543,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 311529422} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -1.31, y: -5.29, z: 0} + m_LocalPosition: {x: -1.75, y: -4.8, z: 0} m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} m_ConstrainProportionsScale: 1 m_Children: [] @@ -2253,7 +2253,6 @@ Transform: - {fileID: 325072784} - {fileID: 310426479} - {fileID: 770877809} - - {fileID: 1467507543} - {fileID: 1343167264} - {fileID: 908447974} m_Father: {fileID: 787643888} @@ -2304,6 +2303,7 @@ MonoBehaviour: isGoldLand: 0 ActivateValue: 0 Num: 0 + Type: 0 paths: - pathPoints: - {fileID: 418966151} @@ -2313,6 +2313,7 @@ MonoBehaviour: - {fileID: 296360679} - {fileID: 1174175337} - {fileID: 1646946173} + - {fileID: 833749038} - pathPoints: - {fileID: 1949570784} - {fileID: 630217766} @@ -2326,7 +2327,6 @@ MonoBehaviour: restTimer: 5 getgoldnumber: 100 goldshop: {fileID: 770877808} - goldnumer: 0 goldNumerTextPro: {fileID: 956953120} HightLight: {fileID: 908447973} Btntrans: {fileID: 559443431} @@ -3636,6 +3636,90 @@ PolygonCollider2D: - {x: 5.616213, y: -10.037206} - {x: 5.700777, y: -10.0731125} - {x: 5.618172, y: 9.981446} +--- !u!1 &833749037 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 833749038} + - component: {fileID: 833749039} + m_Layer: 0 + m_Name: endPos + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &833749038 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 833749037} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -1.75, y: -4.8, z: 0} + m_LocalScale: {x: 0.49999997, y: 0.49999997, z: 0.49999997} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 1343167264} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &833749039 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 833749037} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 1018a775041383b4a83b311a91692a3d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 0} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 0.7, y: 0.7} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 --- !u!1 &866420152 GameObject: m_ObjectHideFlags: 0 @@ -3750,7 +3834,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 559443431} - m_RootOrder: 5 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!212 &908447975 SpriteRenderer: @@ -4144,6 +4228,7 @@ MonoBehaviour: isGoldLand: 0 ActivateValue: 0 Num: 0 + Type: 0 paths: - pathPoints: - {fileID: 202400057} @@ -4166,7 +4251,6 @@ MonoBehaviour: restTimer: 5 getgoldnumber: 100 goldshop: {fileID: 784479835} - goldnumer: 0 goldNumerTextPro: {fileID: 1634093115} HightLight: {fileID: 1642726817} Btntrans: {fileID: 1048058358} @@ -4578,7 +4662,7 @@ Transform: - {fileID: 2084044675} - {fileID: 311529423} m_Father: {fileID: 1343167264} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1302727106 GameObject: @@ -4898,10 +4982,12 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 1467507543} - {fileID: 306345051} - {fileID: 1202945966} + - {fileID: 833749038} m_Father: {fileID: 559443431} - m_RootOrder: 4 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1380133527 GameObject: @@ -5460,12 +5546,12 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1467507542} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 1.9, y: -0.79, z: 0} + m_LocalPosition: {x: 2.8930001, y: -1.7129993, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 559443431} - m_RootOrder: 3 + m_Father: {fileID: 1343167264} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1469919404 GameObject: diff --git a/meng_yao/Assets/script/cultivation_gold_coin_Island/landContorl.cs b/meng_yao/Assets/script/cultivation_gold_coin_Island/landContorl.cs index e714e3bfb..2d9410e2c 100644 --- a/meng_yao/Assets/script/cultivation_gold_coin_Island/landContorl.cs +++ b/meng_yao/Assets/script/cultivation_gold_coin_Island/landContorl.cs @@ -162,10 +162,21 @@ public class landContorl : MonoBehaviour return; } + if (timerStr!=null) + { + fishMan = GameObject.Instantiate(fishManPrefab); + fishMan.transform.position = startPos.position; + fishManShipContorl = fishMan.GetComponent(); + + return; + } + fishMan = GameObject.Instantiate(fishManPrefab); fishMan.transform.position = startPos.position; fishManShipContorl = fishMan.GetComponent(); + + MoveToFishingPos(); } void MoveToFishingPos() From a2cf1f4f4977af505a0f578be6295e2a24f65875 Mon Sep 17 00:00:00 2001 From: hyskai <2545507770@qq.com> Date: Sun, 3 Nov 2024 00:43:37 +0800 Subject: [PATCH 3/3] add --- .../cultivation_gem_island_slices.unity | 223 ++++++++++++++++-- meng_yao/Assets/communal/mount.cs | 2 +- .../cultivation_gold_coin_Island/boy.cs | 30 +-- .../landContorl.cs | 22 +- 4 files changed, 231 insertions(+), 46 deletions(-) diff --git a/meng_yao/Assets/Scenes/cultivation_gem_island_slices.unity b/meng_yao/Assets/Scenes/cultivation_gem_island_slices.unity index f49fabc96..5567f00c0 100644 --- a/meng_yao/Assets/Scenes/cultivation_gem_island_slices.unity +++ b/meng_yao/Assets/Scenes/cultivation_gem_island_slices.unity @@ -626,6 +626,90 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!1 &44899766 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 44899767} + - component: {fileID: 44899768} + m_Layer: 0 + m_Name: endPos + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &44899767 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 44899766} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -4.041, y: -0.026, z: 0} + m_LocalScale: {x: 0.49999997, y: 0.49999997, z: 0.49999997} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 723548395} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &44899768 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 44899766} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 1018a775041383b4a83b311a91692a3d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 0} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 0.7, y: 0.7} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 --- !u!1 &56346248 GameObject: m_ObjectHideFlags: 0 @@ -659,7 +743,6 @@ Transform: - {fileID: 733512740} - {fileID: 1616921918} - {fileID: 1621691473} - - {fileID: 347020761} - {fileID: 723548395} - {fileID: 998933732} m_Father: {fileID: 787643888} @@ -705,11 +788,12 @@ MonoBehaviour: m_EditorClassIdentifier: fishManPrefab: {fileID: 3493682475662937687, guid: 0991c3a29d050114f8900e457bbb5022, type: 3} startPos: {fileID: 347020761} + endPos: {fileID: 44899767} type: 0 isbuy: 1 isGoldLand: 0 - ActivateValue: 0 - Num: 0 + ActivateValue: 5000 + Num: 16 Type: 0 paths: - pathPoints: @@ -737,6 +821,7 @@ MonoBehaviour: HightLight: {fileID: 998933731} Btntrans: {fileID: 56346249} FishPrice: 0 + map: {fileID: 1987825450} --- !u!1 &76149330 GameObject: m_ObjectHideFlags: 0 @@ -857,7 +942,7 @@ Transform: - {fileID: 1620158627} - {fileID: 97294784} m_Father: {fileID: 1853199159} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &97294783 GameObject: @@ -1686,6 +1771,90 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!1 &346538289 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 346538290} + - component: {fileID: 346538291} + m_Layer: 0 + m_Name: endPos + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &346538290 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 346538289} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -5.57, y: -4.83, z: 0} + m_LocalScale: {x: 0.49999997, y: 0.49999997, z: 0.49999997} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 1853199159} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &346538291 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 346538289} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 1018a775041383b4a83b311a91692a3d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 0} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 0.7, y: 0.7} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 --- !u!1 &347020760 GameObject: m_ObjectHideFlags: 0 @@ -1710,12 +1879,12 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 347020760} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 1.49, y: -3.6, z: 0} + m_LocalPosition: {x: 4.01, y: -2.79, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 56346249} - m_RootOrder: 3 + m_Father: {fileID: 723548395} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &402907780 GameObject: @@ -2089,7 +2258,7 @@ Transform: - {fileID: 1050211812} - {fileID: 1711639167} m_Father: {fileID: 723548395} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &505544139 GameObject: @@ -2298,11 +2467,12 @@ MonoBehaviour: m_EditorClassIdentifier: fishManPrefab: {fileID: 2573296898750738764, guid: ad264b5cad6c49547925f7ce059b94bb, type: 3} startPos: {fileID: 1467507543} + endPos: {fileID: 833749038} type: 0 isbuy: 1 isGoldLand: 0 - ActivateValue: 0 - Num: 0 + ActivateValue: 200 + Num: 10 Type: 0 paths: - pathPoints: @@ -2322,6 +2492,7 @@ MonoBehaviour: - {fileID: 15344628} - {fileID: 2084044675} - {fileID: 311529423} + - {fileID: 833749038} pathsNeedTimer: 30 fishingNeedTimer: 30 restTimer: 5 @@ -2331,6 +2502,7 @@ MonoBehaviour: HightLight: {fileID: 908447973} Btntrans: {fileID: 559443431} FishPrice: 0 + map: {fileID: 1987825450} --- !u!1 &582440289 GameObject: m_ObjectHideFlags: 0 @@ -2355,12 +2527,12 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 582440289} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 2.37, y: -1.99, z: 0} + m_LocalPosition: {x: 3.413, y: -1.5529988, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 1048058358} - m_RootOrder: 3 + m_Father: {fileID: 1853199159} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &630217765 GameObject: @@ -2558,10 +2730,12 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 347020761} - {fileID: 467610297} - {fileID: 760608485} + - {fileID: 44899767} m_Father: {fileID: 56346249} - m_RootOrder: 4 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &733512739 GameObject: @@ -2767,7 +2941,7 @@ Transform: - {fileID: 1421307109} - {fileID: 6111264} m_Father: {fileID: 723548395} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &770877808 GameObject: @@ -4090,7 +4264,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 56346249} - m_RootOrder: 5 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!212 &998933733 SpriteRenderer: @@ -4177,7 +4351,6 @@ Transform: - {fileID: 20416359} - {fileID: 1380133528} - {fileID: 784479836} - - {fileID: 582440290} - {fileID: 1853199159} - {fileID: 1642726818} m_Father: {fileID: 787643888} @@ -4223,11 +4396,12 @@ MonoBehaviour: m_EditorClassIdentifier: fishManPrefab: {fileID: 6097386749501479918, guid: a8700ae973e4404429799e98d0f777ee, type: 3} startPos: {fileID: 582440290} + endPos: {fileID: 346538290} type: 0 isbuy: 1 isGoldLand: 0 - ActivateValue: 0 - Num: 0 + ActivateValue: 1000 + Num: 13 Type: 0 paths: - pathPoints: @@ -4255,6 +4429,7 @@ MonoBehaviour: HightLight: {fileID: 1642726817} Btntrans: {fileID: 1048058358} FishPrice: 0 + map: {fileID: 1987825450} --- !u!1 &1050211811 GameObject: m_ObjectHideFlags: 0 @@ -4952,7 +5127,7 @@ Transform: - {fileID: 23420342} - {fileID: 1302727107} m_Father: {fileID: 1853199159} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1343167263 GameObject: @@ -6753,7 +6928,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1048058358} - m_RootOrder: 5 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!212 &1642726819 SpriteRenderer: @@ -7084,7 +7259,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1711639166} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -3.68, y: 0.93, z: 0} + m_LocalPosition: {x: -3.21, y: 0.387, z: 0} m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} m_ConstrainProportionsScale: 1 m_Children: [] @@ -7595,10 +7770,12 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 582440290} - {fileID: 80262540} - {fileID: 1343094554} + - {fileID: 346538290} m_Father: {fileID: 1048058358} - m_RootOrder: 4 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1857952290 GameObject: diff --git a/meng_yao/Assets/communal/mount.cs b/meng_yao/Assets/communal/mount.cs index a3d509251..5c8aa5765 100644 --- a/meng_yao/Assets/communal/mount.cs +++ b/meng_yao/Assets/communal/mount.cs @@ -232,7 +232,7 @@ public class mount : MonoBehaviour //mountitem.login_screen(); } - private void Start() + public virtual void Start() { mountitem = this; LoadAllJsonFiles(); diff --git a/meng_yao/Assets/script/cultivation_gold_coin_Island/boy.cs b/meng_yao/Assets/script/cultivation_gold_coin_Island/boy.cs index 793510577..d840c7e55 100644 --- a/meng_yao/Assets/script/cultivation_gold_coin_Island/boy.cs +++ b/meng_yao/Assets/script/cultivation_gold_coin_Island/boy.cs @@ -8,11 +8,11 @@ public class boy : mount public int currencType = 0;//货币类型 public List listgameobject = new List(); public Dictionary ActivateValues = new Dictionary(); - async void Start() + public override async void Start() { //测试用 Login login = new Login(); - login.Phone = "1"; + login.Phone = "test1"; await web.SendRequest(web.URL + "/Player/Login", "POST", JsonUtility.ToJson(login)); @@ -26,23 +26,31 @@ public class boy : mount } } } + + UpShipTimer(); + } + + + public async void UpShipTimer() + { int index = 0; - foreach (int key in ActivateValues.Keys) { + foreach (int key in ActivateValues.Keys) + { listgameobject[index].GetComponent().ActivateValue = key; listgameobject[index].GetComponent().Num = ActivateValues[key]; index++; } string allfisherman = ""; - + if (currencType == 0)//金币 { allfisherman = await web.SendRequest(web.URL + "/FisherElfActive/GetListOfGold", "POST"); - + } else//宝石 { - allfisherman = await web.SendRequest(web.URL + "/FisherElfActive/GetListOfGem", "POST"); + allfisherman = await web.SendRequest(web.URL + "/FisherElfActive/GetListOfGem", "POST"); } //Debug.Log(allfisherman); Response allfishermanres = JsonUtility.FromJson(allfisherman); @@ -55,19 +63,13 @@ public class boy : mount { if (gameObject.GetComponent().ActivateValue == item.ActivateValue)//如果价格一致 { - Debug.Log(item.RemainEndureTime.ToString() +'/' + item.EndureTime.ToString()); + Debug.Log(item.RemainEndureTime.ToString() + '/' + item.EndureTime.ToString()); gameObject.GetComponent().add_fish(item.RemainEndureTime.ToString() + '/' + item.EndureTime.ToString()); + //gameObject.GetComponent().add_fish(); } } } - - } - - //Debug.Log(Struct.StructToString(ActivateValues.Values, 1)); } - - - } diff --git a/meng_yao/Assets/script/cultivation_gold_coin_Island/landContorl.cs b/meng_yao/Assets/script/cultivation_gold_coin_Island/landContorl.cs index 2d9410e2c..1b6bcda24 100644 --- a/meng_yao/Assets/script/cultivation_gold_coin_Island/landContorl.cs +++ b/meng_yao/Assets/script/cultivation_gold_coin_Island/landContorl.cs @@ -16,6 +16,7 @@ public class landContorl : MonoBehaviour private GameObject fishMan; private shipcontorl fishManShipContorl; public Transform startPos; + public Transform endPos; public int type; public bool isbuy=false; @@ -49,6 +50,7 @@ public class landContorl : MonoBehaviour public float FishPrice; + public GameObject map; // Start is called before the first frame update private void Start() @@ -138,6 +140,7 @@ public class landContorl : MonoBehaviour Promptmgr.Instance.PromptBubble("购买成功", Color.black, Color.red); ScaleAni(Btntrans); add_fish(); + map.GetComponent().UpShipTimer(); } else { @@ -156,6 +159,7 @@ public class landContorl : MonoBehaviour { //倒计时 // fishManShipContorl.UpShowTimer("测试"); + if (fishMan!=null) { fishManShipContorl.UpShowTimer(timerStr); @@ -165,8 +169,9 @@ public class landContorl : MonoBehaviour if (timerStr!=null) { fishMan = GameObject.Instantiate(fishManPrefab); - fishMan.transform.position = startPos.position; + fishMan.transform.position = endPos.position; fishManShipContorl = fishMan.GetComponent(); + MoveToStartPos(); return; } @@ -293,18 +298,17 @@ public class landContorl : MonoBehaviour yield return man.transform.DOPath(pathPoints, pathsNeedTimer, PathType.CatmullRom) .SetOptions(false) // 禁用旋转 .SetEase(Ease.InOutSine) - .WaitForCompletion(); - - // 停止摆动效果 - swayTween.Kill(); + .WaitForCompletion(); //加钱 - AddGold(); - + AddGold(); // 等待捕鱼指定时间 yield return new WaitForSeconds(restTimer); + // 停止摆动效果 + swayTween.Kill(); + //循环 MoveToFishingPos(); } @@ -325,9 +329,11 @@ public class landContorl : MonoBehaviour void AddGold() { Debug.LogError("返航完成,开始:真·摸-鱼,加钱"); - //goldnumer += getgoldnumber; + + goldNumerTextPro.text = ActivateValue.ToString(); fishMan.GetComponent().SetState(ShipState.draw); + } }