From 0b8c78b93544c7193492a3ac2add2cf2c3363691 Mon Sep 17 00:00:00 2001 From: wulongxiao <2545507770@qq.com> Date: Mon, 6 Jan 2025 16:49:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=B2=BE=E7=81=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/script/Scene_jinshadao/BaoshiRoomcontroller.cs | 7 ++++++- .../Assets/script/scene_Main/scene/Scene_baoshikuang.cs | 2 +- meng_yao/Assets/script/scene_jinshakuang/minerControl.cs | 2 +- meng_yao/Assets/script/scene_jinshakuang/roomcontroller.cs | 5 ++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/meng_yao/Assets/script/Scene_jinshadao/BaoshiRoomcontroller.cs b/meng_yao/Assets/script/Scene_jinshadao/BaoshiRoomcontroller.cs index 1b3e9acd..f203f86b 100644 --- a/meng_yao/Assets/script/Scene_jinshadao/BaoshiRoomcontroller.cs +++ b/meng_yao/Assets/script/Scene_jinshadao/BaoshiRoomcontroller.cs @@ -137,7 +137,12 @@ public class BaoshiRoomcontroller : MonoBehaviour musk.gameObject.SetActive(false); fishMan = GameObject.Instantiate(fishManPrefab, this.transform); fishManlist.Add(fishMan); - fishMan.transform.position = endPos.position; + + Vector3 pos = new Vector3(Random.Range((endPos.position.x - startPos.position.x) / 2, endPos.position.x), endPos.position.y, endPos.position.z); + fishMan.transform.position = pos; + + + fishManShipContorl = fishMan.GetComponent(); fishManShipContorl.init(this.paths, this.pathsNeedTimer, this.fishingNeedTimer, this.restTimer, this.startPos, this.endPos); diff --git a/meng_yao/Assets/script/scene_Main/scene/Scene_baoshikuang.cs b/meng_yao/Assets/script/scene_Main/scene/Scene_baoshikuang.cs index 05048626..48f45b86 100644 --- a/meng_yao/Assets/script/scene_Main/scene/Scene_baoshikuang.cs +++ b/meng_yao/Assets/script/scene_Main/scene/Scene_baoshikuang.cs @@ -75,7 +75,7 @@ public class Scene_baoshikuang : MonoBehaviour go.ShipNumber = info.activate_count; index++; } - } + } } diff --git a/meng_yao/Assets/script/scene_jinshakuang/minerControl.cs b/meng_yao/Assets/script/scene_jinshakuang/minerControl.cs index 66d2807d..869837c9 100644 --- a/meng_yao/Assets/script/scene_jinshakuang/minerControl.cs +++ b/meng_yao/Assets/script/scene_jinshakuang/minerControl.cs @@ -62,7 +62,7 @@ public class minerControl : MonoBehaviour public void init(List path,float pathsNeedTimer,float fishingNeedTimer,float restTimer,Transform startPos,Transform endPos) { this.paths = path; - this.pathsNeedTimer = pathsNeedTimer; + this.pathsNeedTimer = pathsNeedTimer+Random.Range(0,10); this.fishingNeedTimer = fishingNeedTimer; this.restTimer = restTimer; this.startPos = startPos; diff --git a/meng_yao/Assets/script/scene_jinshakuang/roomcontroller.cs b/meng_yao/Assets/script/scene_jinshakuang/roomcontroller.cs index b2e7bbbf..b1d4cf54 100644 --- a/meng_yao/Assets/script/scene_jinshakuang/roomcontroller.cs +++ b/meng_yao/Assets/script/scene_jinshakuang/roomcontroller.cs @@ -129,7 +129,10 @@ public class roomcontroller : MonoBehaviour musk.gameObject.SetActive(false); fishMan = GameObject.Instantiate(fishManPrefab, this.transform); fishManlist.Add(fishMan); - fishMan.transform.position = endPos.position; + + Vector3 pos = new Vector3(Random.Range((endPos.position.x-startPos.position.x)/2, endPos.position.x), endPos.position.y, endPos.position.z); + fishMan.transform.position = pos; + fishManShipContorl = fishMan.GetComponent(); fishManShipContorl.init(this.paths, this.pathsNeedTimer, this.fishingNeedTimer, this.restTimer, this.startPos, this.endPos);