This commit is contained in:
2026-08-29 17:28:00 +08:00
parent 1790ec6115
commit efdf80dcbd
22 changed files with 417444 additions and 971121 deletions
@@ -3325,7 +3325,7 @@ MonoBehaviour:
currState: 0
HP: 5
effect_Die: {fileID: 0}
effect_DieAward: {fileID: 335026624795842200, guid: 7c57268c8cf05be4fb334653858c6dff,
effect_DieAward: {fileID: 5119560591553211127, guid: 7c57268c8cf05be4fb334653858c6dff,
type: 3}
currEffect_DieAward: {fileID: 0}
isMove: 1
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b73ca50a9078f4c4fb742f440a7111e2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,270 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &1725624033583170496
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 3446050555171211319, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_LocalScale.x
value: 5
objectReference: {fileID: 0}
- target: {fileID: 3446050555171211319, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_LocalScale.y
value: 5
objectReference: {fileID: 0}
- target: {fileID: 3446050555171211319, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_LocalScale.z
value: 5
objectReference: {fileID: 0}
- target: {fileID: 3446050555171211319, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3446050555171211319, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3446050555171211319, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3446050555171211319, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3446050555171211319, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3446050555171211319, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3446050555171211319, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3446050555171211319, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3446050555171211319, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3446050555171211319, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3446050555171211319, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_ConstrainProportionsScale
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6042158412426053227, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6042158412426053227, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6042158412426053227, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6042158412426053227, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6042158412426053227, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6139625675193079080, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_TagString
value: Fish
objectReference: {fileID: 0}
- target: {fileID: 7007380091307527199, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
propertyPath: m_Name
value: 27
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 7007380091307527199, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
insertIndex: -1
addedObject: {fileID: -92920758511230633}
- targetCorrespondingSourceObject: {fileID: 6139625675193079080, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
insertIndex: -1
addedObject: {fileID: 2164187165272308971}
m_SourcePrefab: {fileID: 100100000, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e, type: 3}
--- !u!4 &4782796877071577010 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6173675881365040242, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
m_PrefabInstance: {fileID: 1725624033583170496}
m_PrefabAsset: {fileID: 0}
--- !u!1 &4811798164641830632 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6139625675193079080, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
m_PrefabInstance: {fileID: 1725624033583170496}
m_PrefabAsset: {fileID: 0}
--- !u!61 &2164187165272308971
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4811798164641830632}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_ForceSendLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ForceReceiveLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ContactCaptureLayers:
serializedVersion: 2
m_Bits: 4294967295
m_CallbackLayers:
serializedVersion: 2
m_Bits: 4294967295
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: -0.014023334, y: 0.14860094}
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.8444891, y: 0.7027981}
m_EdgeRadius: 0
--- !u!1 &8560660071508185055 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7007380091307527199, guid: 825a3a493d3f44b409fbd4cc5eeb4e9e,
type: 3}
m_PrefabInstance: {fileID: 1725624033583170496}
m_PrefabAsset: {fileID: 0}
--- !u!114 &-92920758511230633
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8560660071508185055}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bf1f8eeda890392489e1ded7e866cc31, type: 3}
m_Name:
m_EditorClassIdentifier:
beilv: 0
guid:
lastMoveLineId:
monsterData:
die_Score: 0
isDie: 0
fishTypeConfig:
fishNumber:
fishName:
fishBrief:
fishType: 0
fishScore: 0
killWeight: 0
pathList:
fishImage:
fishMultipleDesc:
moveLine:
bezierCurveData:
name:
start: {x: 0, y: 0}
controlPoints: []
end: {x: 0, y: 0}
moveTime: 0
moveSpeed: 0
cachedCamera: {fileID: 0}
cachedUirootRect: {fileID: 0}
skeleton: {fileID: 0}
isSpine: 1
fishTypeID: 0
currState: 0
HP: 5
effect_Die: {fileID: 0}
effect_DieAward: {fileID: 0}
currEffect_DieAward: {fileID: 0}
isMove: 1
is3D: 0
forwordXYZ: Z
fishenum: 0
moveTime: 0
isyz: 0
yzID:
colliderList: []
lockPoint: {fileID: 4782796877071577010}
bingDongEffect: {fileID: 0}
needLockEvent: 0
createVideoClip: {fileID: 0}
rotationPY: 60
baseMmove: 0
isRotate: 1
isNot1: 0
ischild0: 0
depthOffset: 0
is2DFish: 0
sortOrder2D: 0
bossName: "\u66F2\u7EBF"
isToUI: 1
tMP_CurrBossScore: {fileID: 0}
currBossScoreValue: 0
bossScoreValue: 0
poolNum: 0
prizeCount: 8
ZhuCam: {fileID: 0}
isDieFish: 0
dieTime: 3
v3: {x: 0, y: 0, z: 0}
isLocalCoin: 0
killerSitPos: -1
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c44de8b545908194b9f57c79e7a20619
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -44,7 +44,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 17ec87b17acebc1488fa8a5e845f50c6, type: 3}
m_Name:
m_EditorClassIdentifier:
bjEndUI: {fileID: 0}
bjEndUI: {fileID: 4300126860111980404, guid: 8567856c46aa7a04697767999de42f4c, type: 3}
bjEndUIOffsetY: 150
posID: 0
paoBei: 0
@@ -46,6 +46,7 @@ public class SpecialLaserMove : MonoBehaviour
private readonly HashSet<string> _killed = new HashSet<string>();
private SitPosData _sit; // 击杀者座位
private Transform _turret; // 生成的激光炮台实例(激光节点的父物体)
private Vector2 _lockedDir; // 发射瞬间锁定的方向:激光期间不再旋转,原方向打到爆奖结束
/// <summary>
/// 初始化并开始激光。
@@ -61,6 +62,12 @@ public class SpecialLaserMove : MonoBehaviour
_killed.Clear();
if (fishLayer.value == 0) fishLayer = LayerMask.GetMask("Fish");
// ⭐ 发射瞬间锁定方向:激光开始后不再旋转,沿原方向打到爆奖结束
_lockedDir = CurrentAimDir();
// ⭐ 锁定炮台旋转:激光期间禁用面板对 turretRotate 的旋转(SetRotation 直接跳过)
if (_sit != null) _sit.isLaserLocked = true;
// Inspector 拖的引用是预制体资源上的节点 → 运行时要在【炮台实例】里找同名节点激活
laserBlueHit = ResolveNode(laserBlueHit, _turret);
laserBlue = ResolveNode(laserBlue, _turret);
@@ -95,11 +102,20 @@ public class SpecialLaserMove : MonoBehaviour
// ===== 形态2:紫色(hit → 主激光)=====
yield return PlayForm(laserPurpleHit, laserPurple);
// ===== 两种形态跑完 → 回调(创建方销毁等待 holder / 走结算)=====
// ⭐ 不销毁自身:本组件通常挂在炮台预制体上,炮台由事件流程统一销毁
// ===== 两种形态跑完 → 解锁旋转 + 回调(创建方销毁等待 holder / 走结算)=====
if (_sit != null) _sit.isLaserLocked = false;
onFinished?.Invoke();
}
/// <summary>发射瞬间的瞄准方向(激光锁定用)</summary>
private Vector2 CurrentAimDir()
{
Vector2 dir = _sit.turretRotate != null
? (Vector2)(_sit.turretRotate.rotation * Vector3.up)
: Quaternion.Euler(0, 0, _sit.currentAngle) * Vector2.up;
return dir.sqrMagnitude < 0.0001f ? Vector2.up : dir.normalized;
}
/// <summary>播放一种形态:hit 节点激活 hitTime 秒 → 关 → 主激光激活 laserDuration 秒(期间扫鱼)</summary>
private IEnumerator PlayForm(GameObject hitObj, GameObject laserObj)
{
@@ -119,7 +135,7 @@ public class SpecialLaserMove : MonoBehaviour
SetActive(laserObj, false);
}
/// <summary>沿炮台当前瞄准方向扫一条宽激光,范围内普通鱼全部击杀(同一条只杀一次)</summary>
/// <summary>沿发射瞬间锁定的方向扫一条宽激光(激光期间不旋转),范围内普通鱼全部击杀(同一条只杀一次)</summary>
private void SweepKillFish()
{
if (_sit == null || onHitFish == null) return;
@@ -130,12 +146,8 @@ public class SpecialLaserMove : MonoBehaviour
: (Vector3)_sit.GetBulletStartPos();
origin.z = 0;
// 朝向:turretRotate 的"上"(激光节点挂在炮台里,跟随一起旋转)
Vector2 dir = _sit.turretRotate != null
? (Vector2)(_sit.turretRotate.rotation * Vector3.up)
: Quaternion.Euler(0, 0, _sit.currentAngle) * Vector2.up;
if (dir.sqrMagnitude < 0.0001f) return;
dir.Normalize();
// 朝向:发射瞬间锁定的固定方向(不随瞄准转动,原方向打到爆奖结束)
Vector2 dir = _lockedDir;
// 扫射长度=屏幕对角线(3D 不放特效,只有碰撞判定;特效在炮台里显示)
float len = ScreenDiagonal();
@@ -145,9 +157,10 @@ public class SpecialLaserMove : MonoBehaviour
var hits = Physics2D.OverlapBoxAll(center, new Vector2(len, laserWidth), angle, fishLayer);
foreach (var h in hits)
{
if (!h.CompareTag("Fish")) continue;
// ⭐ 只杀普通鱼(黄金鱼/特殊鱼/Boss/特殊Boss 不可被激光击杀)
var fish = h.GetComponentInParent<MonsterContral>();
if (fish == null || fish.isDead) continue;
if (fish.fishenum != Assets.MyGame.Scripts.Net.APIResponses.Enum.FishTypeEnum.普通鱼) continue;
if (!_killed.Add(fish.guid)) continue; // 同一条鱼只杀一次
onHitFish(fish);
@@ -172,7 +185,8 @@ public class SpecialLaserMove : MonoBehaviour
private void OnDestroy()
{
StopAllCoroutines();
// 兜底:意外销毁时把节点全部复位
// 兜底:意外销毁时解锁旋转 + 把节点全部复位
if (_sit != null) _sit.isLaserLocked = false;
SetActive(laserBlueHit, false);
SetActive(laserBlue, false);
SetActive(laserPurpleHit, false);
@@ -0,0 +1,166 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &2555049829235497414
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 236781439713602893, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_Name
value: UI_baojiang Variant 10
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_AnchorMax.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_AnchorMax.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_AnchorMin.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_AnchorMin.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_SizeDelta.x
value: 100
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_SizeDelta.y
value: 100
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_AnchoredPosition.x
value: -449
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -158
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 685976588209175045, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2278261232015200288, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_Sprite
value:
objectReference: {fileID: -835389033, guid: 68e4fec764425b4438eb6a06c7b99c16,
type: 3}
- target: {fileID: 4213903445032130685, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_SizeDelta.x
value: 187
objectReference: {fileID: 0}
- target: {fileID: 4213903445032130685, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_SizeDelta.y
value: 176
objectReference: {fileID: 0}
- target: {fileID: 4213903445032130685, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_LocalScale.x
value: 5.252784
objectReference: {fileID: 0}
- target: {fileID: 4213903445032130685, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_LocalScale.y
value: 5.252784
objectReference: {fileID: 0}
- target: {fileID: 4213903445032130685, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_LocalScale.z
value: 5.252784
objectReference: {fileID: 0}
- target: {fileID: 4213903445032130685, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 25
objectReference: {fileID: 0}
- target: {fileID: 4213903445032130685, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 165
objectReference: {fileID: 0}
- target: {fileID: 5627438144398829183, guid: a96966a1d55149a4f83724f224013303,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 47.5
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a96966a1d55149a4f83724f224013303, type: 3}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8567856c46aa7a04697767999de42f4c
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,3 +1,4 @@
using Assets.MyGame.Scripts.Net.APIResponses.Enum;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -103,11 +104,12 @@ public class SpecialBulletMove : MonoBehaviour
return;
}
// —— 碰鱼 ——
if (IsFish(other))
// —— 碰鱼:只杀普通鱼(黄金鱼/特殊鱼/Boss/特殊Boss 不可被钻头击杀,穿过)——
if (!IsWall(other))
{
var fish = other.GetComponentInParent<MonsterContral>();
if (fish == null || fish.isDead) return;
if (fish.fishenum != FishTypeEnum.普通鱼) return; // ⭐ 只杀小鱼
// 反弹次数已用完 → 在碰鱼位置最终爆炸:炸死一群鱼 → 钻头消失
if (peng <= 0)
@@ -128,12 +130,6 @@ public class SpecialBulletMove : MonoBehaviour
|| c.CompareTag("Wall");
}
private bool IsFish(Collider2D c)
{
return (fishLayer.value != 0 && ((1 << c.gameObject.layer) & fishLayer.value) != 0)
|| c.CompareTag("Fish");
}
/// <summary>
/// 按墙面法线反弹(ClosestPoint 求近似法线,适配任意方向的墙)。
/// ⭐ 反弹时把钻头沿法线推回墙外(墙最近点 + 钻头半径 + 余量),防止高速下
@@ -172,15 +168,16 @@ public class SpecialBulletMove : MonoBehaviour
if (_exploded) return;
_exploded = true;
// 范围爆炸:炸 explosionRadius 内的普通鱼(同一条鱼只杀一次)
// 范围爆炸:炸 explosionRadius 内的普通鱼(⭐ 只杀小鱼,同一条鱼只杀一次)
if (explosionRadius > 0f && onHitFish != null)
{
var hits = Physics2D.OverlapCircleAll((Vector2)transform.position, explosionRadius, fishLayer);
foreach (var h in hits)
{
if (!IsFish(h)) continue;
if (IsWall(h)) continue;
var fish = h.GetComponentInParent<MonsterContral>();
if (fish == null || fish.isDead) continue;
if (fish.fishenum != FishTypeEnum.普通鱼) continue; // ⭐ 只杀小鱼
if (!_killed.Add(fish.guid)) continue;
onHitFish(fish);
}
@@ -56,18 +56,41 @@ public class ZuanTouXie_DieEvent : DieEffect_TSY
/// </summary>
protected virtual bool restoreTurretAfterProjectile => false;
private bool _routineStarted; // 流程只启动一次(Init/SetCoinCount 双入口防重入)
/// <summary>
/// 参数注入完成即启动整个流程(不再等外部调 SetCoinCount)。
/// ⭐ 不覆写 SetCoinCount:外部(如 not-self 分流检测)发现子类重写了 SetCoinCount 会走原克隆流程,
/// 挪到 Init 里启动后保持基类空实现即可避开。
/// Boss爆奖模式入口:InitBossAward → Init 参数注入完成即启动。
/// (小鱼爆奖模式外部不调 Init,走 SetCoinCount 入口,见下)
/// </summary>
public override void Init(long goldCount, int posID, long paobei, long fishScore, int beishu,
Action<int> action, Action action1 = null)
{
base.Init(goldCount, posID, paobei, fishScore, beishu, action, action1);
StartRoutineOnce();
}
/// <summary>
/// 小鱼爆奖模式入口:CreateFishManager 注入字段后调 SetCoinCount,在这里启动。
/// (Boss 模式已由 Init 启动过,防重入直接跳过)
/// </summary>
public override void SetCoinCount()
{
StartRoutineOnce();
}
private void StartRoutineOnce()
{
if (_routineStarted) return;
_routineStarted = true;
StartCoroutine(MainRoutine());
}
/// <summary>对象池复用:回池(隐藏)/再取用(激活)时复位启动标记,允许重新走流程</summary>
protected virtual void OnEnable()
{
_routineStarted = false;
}
protected virtual IEnumerator MainRoutine()
{
_endShown = false; // 对象池复用安全
@@ -213,7 +236,9 @@ public class ZuanTouXie_DieEvent : DieEffect_TSY
// 倍数:CreateFishManager 已把 killFish.beishu 注入 bJbeishu;此处只做兜底(默认1)
if (bJbeishu <= 0) bJbeishu = 1;
maxScore = (int)coinCount;
isSelf = isLocalCoin;
// 金/银币归属:与 BJEventBase.Init 一致,按击杀者座位判定
// ⭐ 用 MainRoutine 缓存的 _sit(小鱼模式 _targetSit 可能为 null,用它判断会恒 false 显示银色)
isSelf = _sit != null && _sit.user == GameManager.Instance.user.id;
// 父节点:击杀者座位的 UI 爆奖面板挂点(obj_BaoJiangZhongPanelPosition),回退座位自身
// ⭐ UI_baojiang 是 UGUI 面板,必须挂 UI 座位节点下(localPosition=0),不能挂 3D 世界坐标
@@ -296,14 +321,23 @@ public class ZuanTouXie_DieEvent : DieEffect_TSY
return drill;
}
/// <summary>杀小鱼:金币=炮倍×底分,Id_DieFish_FX 帧同步到全房间</summary>
/// <summary>杀鱼(不限类型):金币=炮倍×底分,Id_DieFish_FX 帧同步到全房间;金银按击杀者座位判定</summary>
protected void KillSmallFish(MonsterContral fish)
{
if (fish == null || fish.isDead) return;
// 金/银币:与 BJEventBase.Init 一致,按击杀者座位判定(isLocalCoin 某些路径未注入,不直接依赖)
bool isLocal = _sit != null && _sit.user == GameManager.Instance.user.id;
// 金币飞向点:炮台世界坐标(与普通杀鱼一致,turretWorldPos 已是 Z=0 平面世界坐标)
Vector3 flyTo = _sit.currentTurret != null
? (Vector3)_sit.currentTurret.GetBulletStartWorldPos()
: _sit.turretWorldPos;
CreateFishManager.Instance.Id_DieFish_FX(
fish.guid,
new RedPacketRecord { Amount = paoBei * fish.monsterData.fishTypeConfig.fishScore },
_sit.transform.position, isLocalCoin);
flyTo, isLocal);
}
private void OnDestroy()
File diff suppressed because it is too large Load Diff