From 1df706fa793e643de3fc7f4d226513d59548f088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=88=92=E8=8D=A3=E6=A3=AE?= <7716842+shurongsen@user.noreply.gitee.com> Date: Wed, 30 Oct 2024 23:18:31 +0800 Subject: [PATCH] add --- .../develop_the_main_interface_slices.unity | 27 ++++++++++++ .../Assets/script/ConnactServer/JinShaBuy.cs | 44 +++++++++++++++++++ .../script/ConnactServer/JinShaBuy.cs.meta | 11 +++++ .../Assets/script/ConnactServer/Logo_in.cs | 2 +- .../Assets/script/JumpScene/LanbaoshiBtn.cs | 37 ++++++++++++++++ .../script/JumpScene/LanbaoshiBtn.cs.meta | 11 +++++ meng_yao/Assets/script/Manager/JumpScene.cs | 1 + .../Assets/script/Player/PlayerManager.cs | 19 +++++++- .../cultivation_Jinsha_mine_slices/room.cs | 40 +++++++++++++---- .../landContorl.cs | 1 + 10 files changed, 183 insertions(+), 10 deletions(-) create mode 100644 meng_yao/Assets/script/ConnactServer/JinShaBuy.cs create mode 100644 meng_yao/Assets/script/ConnactServer/JinShaBuy.cs.meta create mode 100644 meng_yao/Assets/script/JumpScene/LanbaoshiBtn.cs create mode 100644 meng_yao/Assets/script/JumpScene/LanbaoshiBtn.cs.meta diff --git a/meng_yao/Assets/Scenes/develop_the_main_interface_slices.unity b/meng_yao/Assets/Scenes/develop_the_main_interface_slices.unity index 3ee56af71..e03a7b057 100644 --- a/meng_yao/Assets/Scenes/develop_the_main_interface_slices.unity +++ b/meng_yao/Assets/Scenes/develop_the_main_interface_slices.unity @@ -1646,6 +1646,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 618926457} + - component: {fileID: 618926458} m_Layer: 0 m_Name: demine01 m_TagString: Untagged @@ -1670,6 +1671,32 @@ Transform: m_Father: {fileID: 1077006413} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!61 &618926458 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 618926456} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0.055420995, y: 0.20321131} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0, y: 0} + oldSize: {x: 0, y: 0} + newSize: {x: 0, y: 0} + adaptiveTilingThreshold: 0 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 1.9975827, y: 1.4064226} + m_EdgeRadius: 0 --- !u!1 &638771785 GameObject: m_ObjectHideFlags: 0 diff --git a/meng_yao/Assets/script/ConnactServer/JinShaBuy.cs b/meng_yao/Assets/script/ConnactServer/JinShaBuy.cs new file mode 100644 index 000000000..602dc78df --- /dev/null +++ b/meng_yao/Assets/script/ConnactServer/JinShaBuy.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + + +[Serializable] +public class RootObject +{ + public List List; + public int ErrorCode; + public string ErrorMessage; +} + +[Serializable] +public class Item +{ + public int Id; + public int Num; + public string Name; + public int ActivateValue; + public int StoreValue; + public float Yield; + public int Limit; + public int EndureTime; + public List ReferrerBouns; + public string CreateDateTime; +} +public class JinShaBuy : MonoBehaviour +{ + + + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + + } +} diff --git a/meng_yao/Assets/script/ConnactServer/JinShaBuy.cs.meta b/meng_yao/Assets/script/ConnactServer/JinShaBuy.cs.meta new file mode 100644 index 000000000..2d1062486 --- /dev/null +++ b/meng_yao/Assets/script/ConnactServer/JinShaBuy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4f60fc87924edb64ba5073ca0de5ec28 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/meng_yao/Assets/script/ConnactServer/Logo_in.cs b/meng_yao/Assets/script/ConnactServer/Logo_in.cs index e2e1301d5..342ec2bc8 100644 --- a/meng_yao/Assets/script/ConnactServer/Logo_in.cs +++ b/meng_yao/Assets/script/ConnactServer/Logo_in.cs @@ -119,7 +119,7 @@ public class Logo_in : mount GameObject.Destroy(this.gameObject); } - + } diff --git a/meng_yao/Assets/script/JumpScene/LanbaoshiBtn.cs b/meng_yao/Assets/script/JumpScene/LanbaoshiBtn.cs new file mode 100644 index 000000000..d863e470b --- /dev/null +++ b/meng_yao/Assets/script/JumpScene/LanbaoshiBtn.cs @@ -0,0 +1,37 @@ +using DG.Tweening; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using System; +using DG.Tweening; +public class LanbaoshiBtn : MonoBehaviour +{ + public static Action OnSceneMouseBTN; + // Start is called before the first frame update + void Start() + { + OnSceneMouseBTN += JUmpScem; + } + + + private void OnMouseDown() + { + //SceneManager.LoadScene(JumpScene.cultivation_Jinsha_mine_slices); + transform.DOScale(new Vector3(0.5f, 0.5f, 0.5f), 0.3f).SetEase(Ease.OutBack); + StartCoroutine("Magnify"); + } + + + IEnumerator Magnify() + { + transform.DOScale(Vector3.one, 0.5f).SetEase(Ease.OutBack); + OnSceneMouseBTN(); + return null; + } + + void JUmpScem() + { + Debug.Log("===="); + SceneGuodu.instance.SlideInAndLoadScene(JumpScene.cultivation_diamond_mines_slices); + } +} diff --git a/meng_yao/Assets/script/JumpScene/LanbaoshiBtn.cs.meta b/meng_yao/Assets/script/JumpScene/LanbaoshiBtn.cs.meta new file mode 100644 index 000000000..62519456e --- /dev/null +++ b/meng_yao/Assets/script/JumpScene/LanbaoshiBtn.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f2333cc3fd27a3f41852e211bb5cdea1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/meng_yao/Assets/script/Manager/JumpScene.cs b/meng_yao/Assets/script/Manager/JumpScene.cs index a2d9e5891..0ff59e282 100644 --- a/meng_yao/Assets/script/Manager/JumpScene.cs +++ b/meng_yao/Assets/script/Manager/JumpScene.cs @@ -33,6 +33,7 @@ public class JumpScene public const string signin= "signin"; public const string upLevel_Scene= "upLevel_Scene"; public const string EcoTree = "EcoTree"; + public const string cultivation_diamond_mines_slices = "cultivation_diamond_mines_slices"; // Start is called before the first frame update diff --git a/meng_yao/Assets/script/Player/PlayerManager.cs b/meng_yao/Assets/script/Player/PlayerManager.cs index f1153be42..2102b3c2b 100644 --- a/meng_yao/Assets/script/Player/PlayerManager.cs +++ b/meng_yao/Assets/script/Player/PlayerManager.cs @@ -80,4 +80,21 @@ public class PlayerManager break; } } -} \ No newline at end of file + + public float GetNumer(MoneyType type) + { + switch (type) + { + case MoneyType.Stones: + return Stones; + case MoneyType.Forging: + return Forging; + case MoneyType.Coins: + return Coins; + case MoneyType.Ore: + return Ore; + } + return 0; + } +} + diff --git a/meng_yao/Assets/script/cultivation_Jinsha_mine_slices/room.cs b/meng_yao/Assets/script/cultivation_Jinsha_mine_slices/room.cs index 69f6cf91f..b8cc66364 100644 --- a/meng_yao/Assets/script/cultivation_Jinsha_mine_slices/room.cs +++ b/meng_yao/Assets/script/cultivation_Jinsha_mine_slices/room.cs @@ -33,7 +33,7 @@ public class room : MonoBehaviour haveNumber = 10; } ChangeTextPro(); - + } private void OnEnable() @@ -67,6 +67,7 @@ public class room : MonoBehaviour if (toolsNumber_text == null) { GetRoom(); + PlayerManager.Instance.SetMoney(MoneyType.Stones, -10); } haveNumber--; @@ -97,10 +98,18 @@ public class room : MonoBehaviour if (toolsNumber_text == null) { GetRoom(); + + Debug.Log("¿ÛÇ®¼ì²â"); + if (PlayerManager.Instance.GetNumer(MoneyType.Stones) < 11) + { + Promptmgr.Instance.PromptBubble("¹ºÂò¾í²»×ã", Color.black, Color.red); + return; + } + PlayerManager.Instance.SetMoney(MoneyType.Stones, -10); } haveNumber--; - toolsNumber--; + toolsNumber--; UpdateShowCazhi(); ChangeTextPro(); @@ -132,6 +141,15 @@ public class room : MonoBehaviour { if (type == this.type) { + Debug.Log("¿ÛÇ®¼ì²â"); + if (PlayerManager.Instance.GetNumer(MoneyType.Coins) < 11) + { + Promptmgr.Instance.PromptBubble("¹ºÂò¾í²»×ã", Color.black, Color.red); + return; + } + PlayerManager.Instance.SetMoney(MoneyType.Coins, -10); + + if ((startPos.childCount + haveNumber) > 9) { Promptmgr.Instance.PromptBubble("¿ó¶´ÒÑÂú", Color.black, Color.red); @@ -142,11 +160,7 @@ public class room : MonoBehaviour { Promptmgr.Instance.PromptBubble("ÈËÊýÒÑÂú", Color.black, Color.red); return; - } - - - - Debug.Log("¿ÛÇ®¼ì²â"); + } haveNumber += num; Promptmgr.Instance.PromptBubble("¹ºÂò³É¹¦"); @@ -161,6 +175,16 @@ public class room : MonoBehaviour { if (type == this.type+1) { + + Debug.Log("¿ÛÇ®¼ì²â"); + if (PlayerManager.Instance.GetNumer(MoneyType.Coins) < 11) + { + Promptmgr.Instance.PromptBubble("¹ºÂò¾í²»×ã", Color.black, Color.red); + return; + } + PlayerManager.Instance.SetMoney(MoneyType.Coins, -10); + + if ((startPos.childCount + toolsNumber) > 9) { Promptmgr.Instance.PromptBubble("¿ó¶´ÒÑÂú", Color.black, Color.red); @@ -173,7 +197,7 @@ public class room : MonoBehaviour return; } - Debug.Log("¿ÛÇ®¼ì²â"); + toolsNumber += 1; Promptmgr.Instance.PromptBubble("¹ºÂò³É¹¦"); 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 0daa7708a..247a487bf 100644 --- a/meng_yao/Assets/script/cultivation_gold_coin_Island/landContorl.cs +++ b/meng_yao/Assets/script/cultivation_gold_coin_Island/landContorl.cs @@ -83,6 +83,7 @@ public class landContorl : MonoBehaviour //Debug.LogError("¼ì²âͨ¹ý"); //Debug.LogError("¿ÛÇ®Âß¼­"); PlayerManager.Instance.SetMoney(MoneyType.Stones, -FishPrice); + fishMan = GameObject.Instantiate(fishManPrefab); //fishMan.transform.SetParent(startPos); fishMan.transform.position = startPos.position;