From df446a618c606898b0a7c1c57e7afef7bb079d74 Mon Sep 17 00:00:00 2001 From: bzx <496597135@qq.com> Date: Thu, 9 Oct 2025 11:08:08 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E5=85=B3=E5=AE=9D=E7=9F=B3=E5=8D=A1=E4=BD=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scenes/Wulanhaote_Wanda_Shangchang.unity | 50 +++++++++++++++++++ Assets/_Alice/Scripts/Base/GameManager.cs | 3 ++ Assets/_Alice/Scripts/Item/BubblesGem.cs | 25 +++++++--- .../Scripts/Task/GemTask/BubblesGemTask.cs | 13 ++++- Assets/_Alice/Scripts/Task/TaskManager.cs | 1 + ProjectSettings/EditorBuildSettings.asset | 4 +- ProjectSettings/ProjectSettings.asset | 2 +- 7 files changed, 87 insertions(+), 11 deletions(-) diff --git a/Assets/_Alice/Scenes/Wulanhaote_Wanda_Shangchang.unity b/Assets/_Alice/Scenes/Wulanhaote_Wanda_Shangchang.unity index b80ca2c3..4fd558c7 100644 --- a/Assets/_Alice/Scenes/Wulanhaote_Wanda_Shangchang.unity +++ b/Assets/_Alice/Scenes/Wulanhaote_Wanda_Shangchang.unity @@ -19486,6 +19486,16 @@ PrefabInstance: propertyPath: m_StaticEditorFlags value: 2147483647 objectReference: {fileID: 0} + - target: {fileID: 4739361030178029374, guid: 7350bae1a92e3a642b078895b43f47f1, + type: 3} + propertyPath: m_LocalPosition.x + value: -9.86 + objectReference: {fileID: 0} + - target: {fileID: 4739361030178029374, guid: 7350bae1a92e3a642b078895b43f47f1, + type: 3} + propertyPath: m_LocalPosition.z + value: -1.77 + objectReference: {fileID: 0} - target: {fileID: 4741766977610483380, guid: 7350bae1a92e3a642b078895b43f47f1, type: 3} propertyPath: m_StaticEditorFlags @@ -19526,6 +19536,16 @@ PrefabInstance: propertyPath: m_StaticEditorFlags value: 2147483647 objectReference: {fileID: 0} + - target: {fileID: 6594359425886852104, guid: 7350bae1a92e3a642b078895b43f47f1, + type: 3} + propertyPath: m_LocalPosition.x + value: -10.89 + objectReference: {fileID: 0} + - target: {fileID: 6594359425886852104, guid: 7350bae1a92e3a642b078895b43f47f1, + type: 3} + propertyPath: m_LocalPosition.z + value: -1.7 + objectReference: {fileID: 0} - target: {fileID: 6621853210474395341, guid: 7350bae1a92e3a642b078895b43f47f1, type: 3} propertyPath: m_LocalPosition.x @@ -19591,6 +19611,16 @@ PrefabInstance: propertyPath: m_StaticEditorFlags value: 2147483647 objectReference: {fileID: 0} + - target: {fileID: 7340799579585126712, guid: 7350bae1a92e3a642b078895b43f47f1, + type: 3} + propertyPath: m_LocalPosition.x + value: -4.82 + objectReference: {fileID: 0} + - target: {fileID: 7340799579585126712, guid: 7350bae1a92e3a642b078895b43f47f1, + type: 3} + propertyPath: m_LocalPosition.z + value: 0.03 + objectReference: {fileID: 0} - target: {fileID: 7403620984591398492, guid: 7350bae1a92e3a642b078895b43f47f1, type: 3} propertyPath: m_StaticEditorFlags @@ -19626,6 +19656,26 @@ PrefabInstance: propertyPath: m_StaticEditorFlags value: 2147483647 objectReference: {fileID: 0} + - target: {fileID: 8469844326909501225, guid: 7350bae1a92e3a642b078895b43f47f1, + type: 3} + propertyPath: m_LocalPosition.x + value: -8.16 + objectReference: {fileID: 0} + - target: {fileID: 8469844326909501225, guid: 7350bae1a92e3a642b078895b43f47f1, + type: 3} + propertyPath: m_LocalPosition.z + value: -1.92 + objectReference: {fileID: 0} + - target: {fileID: 8483622650885395939, guid: 7350bae1a92e3a642b078895b43f47f1, + type: 3} + propertyPath: m_LocalPosition.x + value: -4.76 + objectReference: {fileID: 0} + - target: {fileID: 8483622650885395939, guid: 7350bae1a92e3a642b078895b43f47f1, + type: 3} + propertyPath: m_LocalPosition.z + value: -1.92 + objectReference: {fileID: 0} - target: {fileID: 9014531264708592805, guid: 7350bae1a92e3a642b078895b43f47f1, type: 3} propertyPath: m_StaticEditorFlags diff --git a/Assets/_Alice/Scripts/Base/GameManager.cs b/Assets/_Alice/Scripts/Base/GameManager.cs index 11f0925c..4cbc7592 100644 --- a/Assets/_Alice/Scripts/Base/GameManager.cs +++ b/Assets/_Alice/Scripts/Base/GameManager.cs @@ -83,6 +83,9 @@ public class GameManager : MonoBehaviour //HUDPanel.Show(); //taskManager.bg.SetActive(true); //CreateEnemy(GameLocal.Ins.enemyPos.position, new Vector3(0,180,0)); + //宝石任务 + // enemy.SetState(1); + // taskManager.curTaskId = 1; //拔萝卜任务 // enemy.SetState(2); // taskManager.curTaskId = 2; diff --git a/Assets/_Alice/Scripts/Item/BubblesGem.cs b/Assets/_Alice/Scripts/Item/BubblesGem.cs index 8787da1b..df40540f 100644 --- a/Assets/_Alice/Scripts/Item/BubblesGem.cs +++ b/Assets/_Alice/Scripts/Item/BubblesGem.cs @@ -52,7 +52,6 @@ public class BubblesGem : MonoBehaviour if(gemTypeIndex==3) GameManager.Ins.taskManager.isGetGem = true; StartCoroutine(ShowGem()); - } IEnumerator ShowGem() @@ -62,43 +61,55 @@ public class BubblesGem : MonoBehaviour bubble.SetActive(false); preTx.SetActive(true); MasterAudio.StopAllSoundsOfTransform(transform); - GameManager.Ins.PlaySound3DRPC("1.47",transform); + GameManager.Ins.PlaySound3DRPC("1.47", transform); yield return new WaitForSeconds(0.5f); + pre.SetActive(false); switch (gemType) { case SeekGemType.Fake: fakeGem.SetActive(true); fakeGem.GetComponent().enabled = true; - GameManager.Ins.PlaySound3DRPC("1.31",transform); + GameManager.Ins.PlaySound3DRPC("1.31", transform); break; case SeekGemType.Punish: punishGem.SetActive(true); punishGem.GetComponent().enabled = true; - GameManager.Ins.PlaySound3DRPC("1.32",transform); + GameManager.Ins.PlaySound3DRPC("1.32", transform); break; case SeekGemType.Real: realGem.SetActive(true); - GameManager.Ins.PlaySound3DRPC("1.30",transform); + GameManager.Ins.PlaySound3DRPC("1.30", transform); realGem.transform.DORotate(new Vector3(0, 360, 0), 2f, RotateMode.FastBeyond360) .SetEase(Ease.Linear) - .SetLoops(-1); // -1 表示无限循环 + .SetLoops(-1); break; } _isGet = false; + if (gemType == SeekGemType.Real) { + // 开始飞向手 LaunchTowards(GameManager.Ins.playerRightHand.transform); - yield return !_isMove; + + // ✅ 修复:等待飞行结束 + yield return new WaitUntil(() => !_isMove); + _isGet = true; GameManager.Ins.PlaySound2DRPC("1.9"); + + // 等待展示时间 yield return new WaitForSeconds(4f); GameManager.Ins.taskManager.CompleteTask(); } + yield return new WaitForSeconds(1f); + + // ✅ 保险:确保自己销毁 Destroy(gameObject); } + private void Update() { if(_isMove) diff --git a/Assets/_Alice/Scripts/Task/GemTask/BubblesGemTask.cs b/Assets/_Alice/Scripts/Task/GemTask/BubblesGemTask.cs index 99784aff..8157420c 100644 --- a/Assets/_Alice/Scripts/Task/GemTask/BubblesGemTask.cs +++ b/Assets/_Alice/Scripts/Task/GemTask/BubblesGemTask.cs @@ -28,7 +28,17 @@ public class BubblesGemTask : Task { if (item != null) { - item.GetComponent().GetGem(3); + var bg = item.GetComponent(); + + // ✅ 打断 ShowGem 协程,避免冲突 + bg.StopAllCoroutines(); + + // 强制拿到真实宝石 + bg.gemType = SeekGemType.Real; + bg.GetGem(3); + + // 标记已经拿到 + GameManager.Ins.taskManager.isGetGem = true; break; } } @@ -37,6 +47,7 @@ public class BubblesGemTask : Task public override void CompleteTask() { base.CompleteTask(); + Debug.Log("删除泡泡宝石"); foreach (var item in curGems) { Destroy(item); diff --git a/Assets/_Alice/Scripts/Task/TaskManager.cs b/Assets/_Alice/Scripts/Task/TaskManager.cs index baeb3c29..7ec012a8 100644 --- a/Assets/_Alice/Scripts/Task/TaskManager.cs +++ b/Assets/_Alice/Scripts/Task/TaskManager.cs @@ -63,6 +63,7 @@ public class TaskManager : MonoBehaviour public void CompleteTask() { + tasks[curTaskId].CompleteTask(); curTaskId++; taskHope.SetActive(false); diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index 8dbb9e33..11109223 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -68,7 +68,7 @@ EditorBuildSettings: - enabled: 0 path: Assets/_Alice/Scenes/Wulanhaote_Ouya_Shangchang.unity guid: ec7237f963be2d442aaa46902c24b38d - - enabled: 0 + - enabled: 1 path: Assets/_Alice/Scenes/Wulanhaote_Wanda_Shangchang.unity guid: 76f67502eb2f66d4bbb130fedb962660 - enabled: 0 @@ -89,7 +89,7 @@ EditorBuildSettings: - enabled: 0 path: Assets/_Alice/Scenes/Guangdong_Shenzhen_Guangming_Wanda.unity guid: 67a0d5a6e3d00f5478ab4f506dff24d7 - - enabled: 1 + - enabled: 0 path: Assets/_Alice/Scenes/Liaoning_Anshan_Lishan_Dayuecheng.unity guid: d8200cd0da664b54ba5a776316c68489 m_configObjects: diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index c9278219..de9523f0 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -163,7 +163,7 @@ PlayerSettings: androidSupportedAspectRatio: 1 androidMaxAspectRatio: 2.1 applicationIdentifier: - Android: com.pineappletech.aliceball.liaoninganshanlishandayuecheng + Android: com.pineappletech.aliceball.wulanhaotewandashangchang Standalone: com.DefaultCompany.com.unity.template.ar buildNumber: Standalone: 0