This commit is contained in:
2026-08-16 14:58:50 +08:00
parent cf53476c44
commit 11f6d0c136
8 changed files with 238 additions and 10 deletions
@@ -54245,7 +54245,7 @@ Transform:
m_LocalScale: {x: 5, y: 5, z: 5}
m_ConstrainProportionsScale: 1
m_Children:
- {fileID: 4013435878656712}
- {fileID: 5850673343986883892}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: -0, z: -0}
--- !u!114 &5063558303431289710
@@ -127542,13 +127542,13 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1358131654863699}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
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:
- {fileID: 4923999403905120}
m_Father: {fileID: 4316826217363421}
m_Father: {fileID: 5850673343986883892}
m_LocalEulerAnglesHint: {x: 0, y: -0, z: -0}
--- !u!33 &33821475940159500
MeshFilter:
@@ -342804,3 +342804,35 @@ ParticleSystemRenderer:
m_MeshWeighting2: 1
m_MeshWeighting3: 1
m_MaskInteraction: 0
--- !u!1 &2816489901458699510
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5850673343986883892}
m_Layer: 0
m_Name: GameObject
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5850673343986883892
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2816489901458699510}
serializedVersion: 2
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:
- {fileID: 4013435878656712}
m_Father: {fileID: 4316826217363421}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -48,6 +48,8 @@ public class BJEventBase : MonoBehaviour
public float coinFlyDuration = 0.5f;
/// <summary>金币之间到达的间隔时间(秒)</summary>
public float coinArrivalInterval = 0.1f;
/// <summary>是否显示加分飘字特效(dieFXPrefabAwardTmp_AddScore);false=只加分不飘字</summary>
public bool showAddScoreFX = true;
// ==================== 回调 ====================
public Action JiaFen; // 加分完成回调(回加到玩家金币)
@@ -351,7 +353,7 @@ public class BJEventBase : MonoBehaviour
// 加分弹出特效 + 音效
Transform parent = tMP_Score != null ? tMP_Score.transform.parent : transform;
GameObject addScorePrefab = CreateFishManager.Instance.dieFXPrefabAwardTmp_AddScore;
if (addScorePrefab != null)
if (showAddScoreFX && addScorePrefab != null)
{
var inst = Instantiate(addScorePrefab, parent.position + Vector3.up * 60, Quaternion.identity, parent);
// 优先用 ScoreNumScrollEvent 组件,按 isSelf 切换金/银币样式
@@ -1,7 +1,9 @@
using Assets.MyGame.Scripts.Net.APIResponses.Enum;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Random = UnityEngine.Random;
/// <summary>
/// 爆裂金鲨 Boss 爆奖事件。
@@ -40,6 +42,8 @@ public class BaoLieJinShaEvent : BJEventBase
Action<int> action, Action action1 = null)
{
base.Init(goldCount, posID, paobei, fishScore, beishu, action, action1);
// ⭐ 关闭加金币飘字特效(dieFXPrefabAwardTmp_AddScore),只加分不飘字
showAddScoreFX = false;
// 不在此处启动协程,等待 Boss 通知(TriggerExplosion)
}
@@ -123,6 +127,25 @@ public class BaoLieJinShaEvent : BJEventBase
// → DelayThenScore → StartAddScore → MoveToSit → OnScoreEnd → JiaFen → die
}
/// <summary>
/// 重写 BigPrize:用 BossGlodCoinNotFish 分包(不关联场上鱼),
/// 避免 BossGlodCoinRandrom 从场上随机选普通鱼在各自位置掉金币,
/// 导致"全屏随机位置死飞机爆奖"。爆炸范围鱼的爆奖已由 TriggerExplosion 处理。
/// </summary>
public override List<RedPacketRecord> BigPrize(int min = 10, int max = 15)
{
if (layeredPool == null)
layeredPool = new LayeredPool(maxScore, scoreCount > 0 ? scoreCount : 1);
var v = layeredPool.BossGlodCoinNotFish(Random.Range(min, max) + 1);
int totalAmount = 0;
if (v != null) foreach (var r in v) totalAmount += (int)r.Amount;
Debug.Log($"[BaoLieJinSha] BigPrize: maxScore={maxScore} scoreCount={scoreCount} records={(v != null ? v.Count : 0)} totalAmount={totalAmount}");
return v;
}
/// <summary>
/// 重写 OnScoreEnd:bjEndUI 直接用 _totalCoin(long 精确值)显示。
/// maxScore 是 int,可能截断 long 总金币,所以用 _totalCoin 传给 bjEndUI。
@@ -420,7 +420,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
bjEndUI: {fileID: -382508373279050920, guid: 89e6098c952e72848b877480472799f7, type: 3}
useScorePanel: 1
useScorePanel: 0
tMP_Score: {fileID: 0}
scorePanelPrefab: {fileID: 1345928542973131, guid: 68cbd28cad4308848b2b96b1cc6d60c4,
type: 3}
@@ -438,6 +438,7 @@ MonoBehaviour:
bjEndUIOffsetY: 150
coinFlyDuration: 0.5
coinArrivalInterval: 0.1
showAddScoreFX: 1
isSelf: 0
autoFinishOnScoreFull: 1
totalBJCount: 0
@@ -1,5 +1,136 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &2468048320071001356
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 7119845037121609897}
m_Modifications:
- target: {fileID: 1195924899020848, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 1393797791154795, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_Name
value: PW_Effect_WreckingBall_Bullet_Hole
objectReference: {fileID: 0}
- target: {fileID: 1393797791154795, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 1566368143105553, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 1601756430231707, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 1643271092100448, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 1660978978941465, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 1837520487406500, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 4153774032717963, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_LocalScale.x
value: 5
objectReference: {fileID: 0}
- target: {fileID: 4153774032717963, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_LocalScale.y
value: 5
objectReference: {fileID: 0}
- target: {fileID: 4153774032717963, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_LocalScale.z
value: 5
objectReference: {fileID: 0}
- target: {fileID: 4304261521604642, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_LocalScale.x
value: 5
objectReference: {fileID: 0}
- target: {fileID: 4304261521604642, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_LocalScale.y
value: 5
objectReference: {fileID: 0}
- target: {fileID: 4304261521604642, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_LocalScale.z
value: 5
objectReference: {fileID: 0}
- target: {fileID: 4748952950016484, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4748952950016484, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4748952950016484, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4748952950016484, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4748952950016484, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4748952950016484, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4748952950016484, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_LocalRotation.w
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: 4748952950016484, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4748952950016484, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_LocalRotation.y
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: 4748952950016484, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4748952950016484, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4748952950016484, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 90
objectReference: {fileID: 0}
- target: {fileID: 4748952950016484, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4748952950016484, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
propertyPath: m_ConstrainProportionsScale
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 7ffd8637f3711e4449e951f0af0c2bc8, type: 3}
--- !u!4 &2472647698502708456 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4748952950016484, guid: 7ffd8637f3711e4449e951f0af0c2bc8,
type: 3}
m_PrefabInstance: {fileID: 2468048320071001356}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &7115756860522828924
PrefabInstance:
m_ObjectHideFlags: 0
@@ -22,7 +153,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4013435878656712, guid: dc96b58c5624d4a4c81915c1a96c1d2e, type: 3}
propertyPath: m_LocalPosition.y
value: -10
value: -2
objectReference: {fileID: 0}
- target: {fileID: 4316826217363421, guid: dc96b58c5624d4a4c81915c1a96c1d2e, type: 3}
propertyPath: m_LocalScale.x
@@ -99,7 +230,11 @@ PrefabInstance:
m_RemovedComponents:
- {fileID: 5063558303431289710, guid: dc96b58c5624d4a4c81915c1a96c1d2e, type: 3}
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedGameObjects:
- targetCorrespondingSourceObject: {fileID: 4216074634867925, guid: dc96b58c5624d4a4c81915c1a96c1d2e,
type: 3}
insertIndex: 0
addedObject: {fileID: 2472647698502708456}
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 1129806422034794, guid: dc96b58c5624d4a4c81915c1a96c1d2e,
type: 3}
@@ -206,7 +341,7 @@ MonoBehaviour:
type: 3}
effectOtherAddSource: {fileID: 1800583966427392384, guid: bf5cb5268d2a7db4488bd300183711aa,
type: 3}
addSourceSpawnRate: 100
addSourceSpawnRate: 50
addSourceDuration: 1
addSourceLifetime: 1.5
currAnimType: 0
@@ -259,6 +394,12 @@ GameObject:
type: 3}
m_PrefabInstance: {fileID: 7115756860522828924}
m_PrefabAsset: {fileID: 0}
--- !u!4 &7119845037121609897 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4216074634867925, guid: dc96b58c5624d4a4c81915c1a96c1d2e,
type: 3}
m_PrefabInstance: {fileID: 7115756860522828924}
m_PrefabAsset: {fileID: 0}
--- !u!114 &7157686033157235909 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 114009115652501689, guid: dc96b58c5624d4a4c81915c1a96c1d2e,
@@ -445,7 +445,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
bjEndUI: {fileID: 1802125635684025862, guid: f4260676fdcc61746abc00242feb25f1, type: 3}
useScorePanel: 1
useScorePanel: 0
tMP_Score: {fileID: 0}
scorePanelPrefab: {fileID: 0}
currScore: 0
@@ -478,6 +478,7 @@ MonoBehaviour:
neiDir: 1
scoreStartDelay: 0.5
tMP_BeiShu: {fileID: 2405853204840994603}
explosionCenter: {x: 0, y: 0, z: 0}
--- !u!224 &1897825713103446877 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 224189813982777168, guid: a6cf5d80cc474df44ba67c8d6baa0903,
@@ -6,6 +6,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using Unity.VisualScripting;
using UnityEngine;
using Random = UnityEngine.Random;
@@ -54,6 +55,12 @@ public class RotatePan_XJMH : BJEventBase
private Tween _waiTween;
private Tween _neiTween;
/// <summary>UI 画布(用于世界坐标→UI 坐标转换,懒加载)</summary>
private Canvas _uiCanvas;
/// <summary>爆炸中心(世界坐标,由 Boss 传入=飞船死亡位置)</summary>
[HideInInspector]
public Vector3 explosionCenter = Vector3.zero;
/// <summary>内层选项(服务端下发,OptionId=索引)</summary>
private BossKillOption _innerOpt;
/// <summary>外层选项(服务端下发,OptionId=索引)</summary>
@@ -70,6 +77,19 @@ public class RotatePan_XJMH : BJEventBase
Action<int> action, Action action1 = null)
{
base.Init(goldCount, posID, paobei, fishScore, beishu, action, action1);
if (_uiCanvas == null && UIManager.Instance != null && UIManager.Instance.uiRoot != null)
_uiCanvas = UIManager.Instance.uiRoot.GetComponent<Canvas>();
var rect = GetComponent<RectTransform>();
if (_uiCanvas != null && rect != null)
{
Vector2 uiPos = CoordinateTransformation.WorldPos_ToCanvas(explosionCenter, _uiCanvas);
rect.anchoredPosition = uiPos;
}
else
{
// 兜底:直接用世界坐标
transform.position = explosionCenter;
}
ParseOptions();
StartCoroutine(RotateThenScore());
}
@@ -25,12 +25,20 @@ public class XingYunFeiDie_BOSS : MonsterControl_BossBase
action_effect_DieAward = (o) =>
{
if (obj == null) return;
// ⭐ 克隆位置 = 飞船死亡位置
Vector3 diePos = transform.position;
foreach (var item in CreateFishManager.Instance.currGameType.list_Sits)
{
if (item.user == obj.userId)
{
var v = o.GetComponent<BJEventBase>();
// 设置爆炸中心为死亡位置
var evt = v as RotatePan_XJMH;
if (evt != null)
{
evt.explosionCenter = diePos;
}
v.Init(
obj.gold, // goldCount(最终回加金币)
item.posID, // posID(击杀者座位)