This commit is contained in:
2026-08-17 19:25:55 +08:00
parent 9200672684
commit e5720819f9
5 changed files with 262 additions and 90 deletions
+1 -1
View File
@@ -5691,7 +5691,7 @@ Camera:
m_Depth: 1
m_CullingMask:
serializedVersion: 2
m_Bits: 511
m_Bits: 479
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
@@ -8,10 +8,30 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1481308560305766, guid: f12be87dd1bebd24b953b75017dd5df9, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1614731731110972, guid: f12be87dd1bebd24b953b75017dd5df9, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1617017305267501, guid: f12be87dd1bebd24b953b75017dd5df9, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1617400629896743, guid: f12be87dd1bebd24b953b75017dd5df9, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1737156032302809, guid: f12be87dd1bebd24b953b75017dd5df9, type: 3}
propertyPath: m_Name
value: PW_Prop_GammaStorm Variant
objectReference: {fileID: 0}
- target: {fileID: 1835424920858806, guid: f12be87dd1bebd24b953b75017dd5df9, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4792597066863454, guid: f12be87dd1bebd24b953b75017dd5df9, type: 3}
propertyPath: m_LocalScale.x
value: 5
@@ -1,67 +1,5 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &307547920300082989
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 674108335875202383}
m_Layer: 8
m_Name: PropR
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &674108335875202383
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 307547920300082989}
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: []
m_Father: {fileID: 7953937869194624889}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &5298270129266653034
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4170147225323388715}
m_Layer: 8
m_Name: PropL
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4170147225323388715
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5298270129266653034}
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: []
m_Father: {fileID: 7953937869194624889}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &7958789352574883945
PrefabInstance:
m_ObjectHideFlags: 0
@@ -74,6 +12,22 @@ PrefabInstance:
propertyPath: m_Name
value: PW_Prop_Symmetra Variant
objectReference: {fileID: 0}
- target: {fileID: 1460440725290411, guid: cfa85e48a7bc26a42af61baeff75b437, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1892118428319368, guid: cfa85e48a7bc26a42af61baeff75b437, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4172521708677671, guid: cfa85e48a7bc26a42af61baeff75b437, type: 3}
propertyPath: m_LocalPosition.x
value: 0.572
objectReference: {fileID: 0}
- target: {fileID: 4791054750901418, guid: cfa85e48a7bc26a42af61baeff75b437, type: 3}
propertyPath: m_LocalPosition.x
value: 0.548
objectReference: {fileID: 0}
- target: {fileID: 4887217528661776, guid: cfa85e48a7bc26a42af61baeff75b437, type: 3}
propertyPath: m_LocalScale.x
value: 5
@@ -133,24 +87,10 @@ PrefabInstance:
- target: {fileID: 7009566739019365143, guid: cfa85e48a7bc26a42af61baeff75b437,
type: 3}
propertyPath: _animationName
value: stand01
value:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects:
- targetCorrespondingSourceObject: {fileID: 4887217528661776, guid: cfa85e48a7bc26a42af61baeff75b437,
type: 3}
insertIndex: 1
addedObject: {fileID: 4170147225323388715}
- targetCorrespondingSourceObject: {fileID: 4887217528661776, guid: cfa85e48a7bc26a42af61baeff75b437,
type: 3}
insertIndex: -1
addedObject: {fileID: 674108335875202383}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: cfa85e48a7bc26a42af61baeff75b437, type: 3}
--- !u!4 &7953937869194624889 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4887217528661776, guid: cfa85e48a7bc26a42af61baeff75b437,
type: 3}
m_PrefabInstance: {fileID: 7958789352574883945}
m_PrefabAsset: {fileID: 0}
@@ -1,3 +1,4 @@
using Assets.MyGame.Scripts.Net.APIResponses.Enum;
using Newtonsoft.Json.Linq;
using System;
using System.Collections;
@@ -121,6 +122,8 @@ public class XingJiXunHangEvent : BJEventBase
public string tapTipName = "tap_tip";
[Tooltip("knock_tip 子物体名(敲击提示,需设置海报Sprite)")]
public string knockTipName = "knock_tip";
[Tooltip("Tip 容器子物体名(tap_tip/knock_tip 的父级,序列结束后隐藏,所有形态通用)")]
public string tipContainerName = "Tip";
// ==================== Prop 子物体名称配置 ====================
@@ -129,6 +132,11 @@ public class XingJiXunHangEvent : BJEventBase
public string ironFistHoleName = "Hole";
[Tooltip("铁拳-Hand子物体名(Hole隐藏后激活)")]
public string ironFistHandName = "Hand";
[Tooltip("铁拳-Hole终点偏移(世界单位,往屏幕内偏移,如 (1.5, 1, 0) 从左下角往右上挪一点)")]
public Vector3 ironFistCornerOffset = new Vector3(1.5f, 1f, 0f);
[Tooltip("铁拳-Hole 到位后停留时长(秒),让玩家看清再释放 Hand(默认0.5)")]
public float ironFistHoldDelay = 0.5f;
[Header("光子 Prop 子物体名称")]
[Tooltip("光子-Lock子物体名(到屏幕中心后隐藏)")]
@@ -140,6 +148,31 @@ public class XingJiXunHangEvent : BJEventBase
[Tooltip("光子-laser子物体名(PropL/PropR到位后激活)")]
public string symmetraLaserName = "laser";
[Tooltip("光子-laser 激活后上下摆动幅度(世界单位)")]
public float laserSwingAmplitude = 0.5f;
[Tooltip("光子-laser 激活后上下摆动来回次数(0=不摆动)")]
public int laserSwingCycles = 0;
[Header("光子 - 电网扫动杀鱼")]
[Tooltip("电网(Prop整体)上下扫动幅度(世界单位)")]
public float netSweepAmplitude = 5f;
[Tooltip("电网上下扫动来回次数(0=不扫动)")]
public int netSweepCycles = 3;
[Tooltip("电网每次扫动耗时(秒)")]
public float netSweepSpeed = 0.8f;
[Tooltip("电网杀鱼检测半径(世界单位,电网线两侧厚度)")]
public float netKillRadius = 1f;
[Tooltip("电网杀鱼检测层(Fish,Inspector 选 Fish 层)")]
public LayerMask netKillLayer;
[Tooltip("电网是否杀鱼(碰到飞机飞机爆炸)")]
public bool netKillFish = true;
// ==================== 爆奖配置 ====================
[Header("爆奖配置")]
@@ -195,6 +228,9 @@ public class XingJiXunHangEvent : BJEventBase
/// <summary>当前选中的海报Sprite</summary>
private Sprite _posterSprite;
/// <summary>本局电网已炸的鱼 guid(防止扫动中重复炸同一鱼)</summary>
private readonly HashSet<string> _netKilledFish = new HashSet<string>();
/// <summary>爆奖过程中实例化的所有临时特效(die() 时统一销毁,防止残留)</summary>
private readonly System.Collections.Generic.List<GameObject> _spawnedEffects = new System.Collections.Generic.List<GameObject>();
@@ -247,6 +283,7 @@ public class XingJiXunHangEvent : BJEventBase
_posterSprite = null;
bossCtrl = null;
diePos = Vector3.zero;
_netKilledFish.Clear();
// ⭐ 对象池复用:清理上次残留的临时特效
for (int i = 0; i < _spawnedEffects.Count; i++)
@@ -306,6 +343,7 @@ public class XingJiXunHangEvent : BJEventBase
/// <summary>根据武器 ID 选择对应的预制体和标签</summary>
private void SelectWeaponPrefabs()
{
//_weaponId = 8;
switch (_weaponId)
{
case 0:
@@ -427,8 +465,12 @@ public class XingJiXunHangEvent : BJEventBase
_spawnedEffects.Add(fullScreenObj); // 加入统一销毁列表
Debug.Log("[XingJiXunHang] Phase2: 全屏特效(自己)");
// 执行 tap_tip → knock_tip 序列
// 执行 tap_tip → knock_tip 序列(序列内部已把 Tip 隐藏)
yield return StartCoroutine(PlayFullScreenTipSequence(fullScreenObj));
// ⭐ FullScreen 克隆对象本身不提前销毁(只隐藏 Tip),保留到爆奖结束,
// 由 die() 统一销毁/回收(_spawnedEffects 列表管理)
Debug.Log("[XingJiXunHang] FullScreen UI 框保留到爆奖结束(Tip 已隐藏)");
}
else
{
@@ -566,11 +608,12 @@ public class XingJiXunHangEvent : BJEventBase
/// <summary>
/// 全屏特效的 tap_tip → knock_tip 序列(美术规格要求)。
/// 1. 激活 tap_tip
/// 2. 等待 tapTipDuration
/// 3. 激活 knock_tip(设置海报Sprite)
/// 4. 等待 knockTipDuration
/// 5. 隐藏 tap_tip 和 knock_tip
/// 1. 激活 Tip 容器(tap_tip/knock_tip 的父级,保证子物体能显示)
/// 2. 激活 tap_tip
/// 3. 等待 tapTipDuration
/// 4. 激活 knock_tip(设置海报Sprite)
/// 5. 等待 knockTipDuration
/// 6. 隐藏 Tip 容器(连带 tap_tip/knock_tip 一起隐藏,所有形态通用)
/// </summary>
private IEnumerator PlayFullScreenTipSequence(GameObject fullScreenObj)
{
@@ -579,6 +622,10 @@ public class XingJiXunHangEvent : BJEventBase
// 查找子物体
Transform tapTip = FindChildRecursive(fullScreenObj.transform, tapTipName);
Transform knockTip = FindChildRecursive(fullScreenObj.transform, knockTipName);
Transform tipContainer = FindChildRecursive(fullScreenObj.transform, tipContainerName);
// ⭐ 序列开始前确保 Tip 容器激活(否则里面的 tap_tip/knock_tip 激活了也看不到)
if (tipContainer != null) tipContainer.gameObject.SetActive(true);
// 初始隐藏
if (tapTip != null) tapTip.gameObject.SetActive(false);
@@ -616,9 +663,14 @@ public class XingJiXunHangEvent : BJEventBase
yield return new WaitForSeconds(knockTipDuration);
// 3. 隐藏 Tip
// 3. ⭐ 隐藏 Tip(隐藏 Tip 容器 + 显式隐藏 tap_tip/knock_tip,所有形态通用)
if (tapTip != null) tapTip.gameObject.SetActive(false);
if (knockTip != null) knockTip.gameObject.SetActive(false);
if (tipContainer != null)
{
tipContainer.gameObject.SetActive(false);
Debug.Log($"[XingJiXunHang] FullScreen: 隐藏 Tip 容器 {tipContainerName}");
}
Debug.Log("[XingJiXunHang] FullScreen: 隐藏 Tip");
}
@@ -675,12 +727,16 @@ public class XingJiXunHangEvent : BJEventBase
yield return new WaitForSeconds(0.2f);
// 2. Hole 移动到屏幕左下角
Vector3 bottomLeft = GetScreenBottomLeft();
// 2. Hole 移动到屏幕左下角(加偏移,往屏幕内挪一点)
Vector3 bottomLeft = GetScreenBottomLeft() + ironFistCornerOffset;
if (hole != null)
{
yield return StartCoroutine(MoveTo(hole, bottomLeft, propAnimDuration));
Debug.Log("[XingJiXunHang] 铁拳: Hole移动到左下角");
Debug.Log($"[XingJiXunHang] 铁拳: Hole移动到左下角+偏移 {bottomLeft}");
// ⭐ Hole 到位后停留 0.5 秒,让玩家看清再释放(之前太快直接释放 Hand)
yield return new WaitForSeconds(ironFistHoldDelay);
Debug.Log($"[XingJiXunHang] 铁拳: Hole 到位停留 {ironFistHoldDelay}s");
}
// 3. 隐藏 Hole
@@ -749,12 +805,155 @@ public class XingJiXunHangEvent : BJEventBase
if (laser != null)
{
laser.gameObject.SetActive(true);
Debug.Log("[XingJiXunHang] 光子: 激活laser");
// ⭐ laser 里的 LineRenderer:端点用 左右(PropL/PropR)里面各自的 laser 子对象位置
var lr = laser.GetComponent<LineRenderer>();
if (lr != null && propL != null && propR != null)
{
// 找左右里面的 laser 发射点对象(找不到则回退用 PropL/PropR 自身)
Transform laserL = FindChildRecursive(propL, symmetraLaserName);
Transform laserR = FindChildRecursive(propR, symmetraLaserName);
Vector3 endL = laserL != null ? laserL.position : propL.position;
Vector3 endR = laserR != null ? laserR.position : propR.position;
lr.positionCount = 2;
if (lr.useWorldSpace)
{
lr.SetPosition(0, endL);
lr.SetPosition(1, endR);
}
else
{
// 本地坐标空间:转成 laser 的本地坐标
lr.SetPosition(0, laser.InverseTransformPoint(endL));
lr.SetPosition(1, laser.InverseTransformPoint(endR));
}
Debug.Log($"[XingJiXunHang] 光子: laser LineRenderer 端点 L={endL} R={endR} useWorldSpace={lr.useWorldSpace}");
}
else
{
Debug.LogWarning($"[XingJiXunHang] 光子: laser 无 LineRenderer 或 PropL/PropR 为空(lr={lr != null} propL={propL != null} propR={propR != null})");
}
// ⭐ laser 设置好并激活后,上下摆动(让激光看起来在动)
if (laserSwingCycles > 0)
{
yield return StartCoroutine(LaserSwing(laser, laserSwingAmplitude, laserSwingCycles));
}
}
// ⭐ 电网:Prop 整体上下扫动 + 碰到飞机(鱼)爆炸
if (netSweepCycles > 0)
{
yield return StartCoroutine(ElectricNetSweep(propObj, propL, propR));
}
yield return new WaitForSeconds(0.3f);
}
/// <summary>
/// 电网扫动:Prop 整体上下移动(幅度 netSweepAmplitude,来回 netSweepCycles 次),
/// 扫动过程中每帧检测 PropL~PropR 之间的矩形区域,碰到普通鱼 → 爆炸(Id_DieFish_FX)。
/// </summary>
private IEnumerator ElectricNetSweep(GameObject propObj, Transform propL, Transform propR)
{
if (propObj == null) yield break;
Vector3 basePos = propObj.transform.position;
for (int i = 0; i < netSweepCycles; i++)
{
// 上扫
yield return StartCoroutine(SweepSegment(propObj, propL, propR, basePos + Vector3.up * netSweepAmplitude));
// 下扫
yield return StartCoroutine(SweepSegment(propObj, propL, propR, basePos - Vector3.up * netSweepAmplitude));
}
// 回原位
yield return StartCoroutine(SweepSegment(propObj, propL, propR, basePos));
Debug.Log($"[XingJiXunHang] 光子: 电网扫动完成 cycles={netSweepCycles} 炸鱼数={_netKilledFish.Count}");
}
/// <summary>电网从当前位置移动到 dest(逐帧插值 + 途中杀鱼)</summary>
private IEnumerator SweepSegment(GameObject propObj, Transform propL, Transform propR, Vector3 dest)
{
if (propObj == null) yield break;
Vector3 start = propObj.transform.position;
float elapsed = 0f;
while (elapsed < netSweepSpeed)
{
elapsed += Time.deltaTime;
float t = netSweepSpeed > 0 ? elapsed / netSweepSpeed : 1f;
if (t > 1f) t = 1f;
propObj.transform.position = Vector3.Lerp(start, dest, t);
if (netKillFish)
KillFishInNet(propL, propR);
yield return null;
}
propObj.transform.position = dest;
if (netKillFish)
KillFishInNet(propL, propR);
}
/// <summary>检测 PropL~PropR 之间的矩形电网区域,普通鱼直接爆炸</summary>
private void KillFishInNet(Transform propL, Transform propR)
{
if (propL == null || propR == null) return;
if (netKillLayer.value == 0)
{
Debug.LogWarning("[XingJiXunHang] 电网杀鱼层 netKillLayer 未设置(Inspector 选 Fish 层),跳过杀鱼");
netKillFish = false; // 只提示一次
return;
}
// 电网矩形区域:左右端 ± 半径
float radius = Mathf.Max(0.1f, netKillRadius);
Vector2 min = new Vector2(
Mathf.Min(propL.position.x, propR.position.x) - radius,
Mathf.Min(propL.position.y, propR.position.y) - radius);
Vector2 max = new Vector2(
Mathf.Max(propL.position.x, propR.position.x) + radius,
Mathf.Max(propL.position.y, propR.position.y) + radius);
Collider2D[] hits = Physics2D.OverlapAreaAll(min, max, netKillLayer);
if (hits == null || hits.Length == 0) return;
Vector3 sitPos = GetSeatPosition();
int killed = 0;
foreach (var hit in hits)
{
if (hit == null || !hit.CompareTag("Fish")) continue;
var monster = hit.GetComponentInParent<MonsterContral>();
if (monster == null) continue;
if (monster.fishenum != FishTypeEnum.普通鱼) continue; // 只炸普通鱼
if (!_netKilledFish.Add(monster.guid)) continue; // 已炸过跳过
var coinNum = new RedPacketRecord
{
Amount = paoBei * monster.monsterData.fishTypeConfig.fishScore
};
CreateFishManager.Instance.Id_DieFish_FX(monster.guid, coinNum, sitPos, isLocal: isSelf);
killed++;
}
if (killed > 0)
Debug.Log($"[XingJiXunHang] 电网炸鱼 {killed} 条");
}
/// <summary>laser 上下摆动动画(幅度 amplitude,来回 cycles 次,结束后回到原位)</summary>
private IEnumerator LaserSwing(Transform target, float amplitude, int cycles)
{
if (target == null) yield break;
Vector3 basePos = target.position;
for (int i = 0; i < cycles; i++)
{
yield return StartCoroutine(MoveTo(target, basePos + Vector3.up * amplitude, 0.3f));
yield return StartCoroutine(MoveTo(target, basePos - Vector3.up * amplitude, 0.3f));
}
// 回到原位
yield return StartCoroutine(MoveTo(target, basePos, 0.2f));
Debug.Log($"[XingJiXunHang] 光子: laser 上下摆动完成 cycles={cycles}");
}
/// <summary>
/// 伽马风暴道具动画(美术规格):
/// 1. Prop 从死亡位置移动到屏幕中心
@@ -62,6 +62,7 @@ MonoBehaviour:
bjEndUIOffsetY: 150
coinFlyDuration: 0.5
coinArrivalInterval: 0.1
showAddScoreFX: 1
isSelf: 0
autoFinishOnScoreFull: 1
totalBJCount: 0
@@ -117,10 +118,22 @@ MonoBehaviour:
knockTipName: knock_tip
ironFistHoleName: Hole
ironFistHandName: Hand
ironFistCornerOffset: {x: 15, y: 10, z: 0}
ironFistHoldDelay: 0.5
symmetraLockName: Lock
symmetraPropLName: PropL
symmetraPropRName: PropR
symmetraLaserName: laser
laserSwingAmplitude: 0.5
laserSwingCycles: 0
netSweepAmplitude: 20
netSweepCycles: 3
netSweepSpeed: 3
netKillRadius: 1
netKillLayer:
serializedVersion: 2
m_Bits: 64
netKillFish: 1
bjCount: 1
bjMinCount: 10
bjMaxCount: 15