This commit is contained in:
2026-09-03 19:39:06 +08:00
parent 6984333297
commit 3081942895
9 changed files with 1672 additions and 219 deletions
+3 -1
View File
@@ -802,7 +802,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!4 &4659075296069922
Transform:
m_ObjectHideFlags: 0
@@ -890,6 +890,8 @@ MonoBehaviour:
isNot1: 0
ischild0: 1
depthOffset: 560
is2DFish: 0
sortOrder2D: 0
--- !u!1 &1470420886364660
GameObject:
m_ObjectHideFlags: 0
+191 -184
View File
@@ -1,5 +1,82 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2564128008921513
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5223238392694687}
- component: {fileID: 7416975800075197}
m_Layer: 6
m_Name: GameObject
m_TagString: Fish
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5223238392694687
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2564128008921513}
serializedVersion: 2
m_LocalRotation: {x: -0, y: 0.7071068, z: -0, w: 0.7071068}
m_LocalPosition: {x: -0.16296482, y: -0.122039795, z: 0.15131095}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1420790864982329365}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &7416975800075197
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2564128008921513}
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: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
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, y: 1}
m_EdgeRadius: 0
--- !u!1 &23267125243866503
GameObject:
m_ObjectHideFlags: 0
@@ -11,7 +88,7 @@ GameObject:
- component: {fileID: 1420790864982329365}
- component: {fileID: 8522120771046664843}
m_Layer: 14
m_Name: 1
m_Name: Z_1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -40,6 +117,72 @@ Transform:
- {fileID: 5223238392694687}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &8522120771046664843
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 23267125243866503}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5e5dca86a57fe2144a34f1f2ddb93962, 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: 11004
currState: 0
HP: 5
effect_Die: {fileID: 0}
effect_DieAward: {fileID: 0}
currEffect_DieAward: {fileID: 0}
isMove: 1
is3D: 1
forwordXYZ: -Z
fishenum: 0
moveTime: 0
isyz: 0
yzID:
colliderList: []
lockPoint: {fileID: 7919990334340192164}
bingDongEffect: {fileID: 4067042857930265640}
needLockEvent: 0
createVideoClip: {fileID: 0}
rotationPY: 60
baseMmove: 0
isRotate: 1
isNot1: 0
ischild0: 1
depthOffset: 560
is2DFish: 0
sortOrder2D: 0
--- !u!1 &173797174121316484
GameObject:
m_ObjectHideFlags: 0
@@ -65,7 +208,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 173797174121316484}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 1, z: 0, w: 0.00000016858739}
m_LocalRotation: {x: 0, y: 0, z: 0.5, w: 0.8660254}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1.4, y: 1.4, z: 1.4}
m_ConstrainProportionsScale: 0
@@ -74,7 +217,7 @@ Transform:
- {fileID: 7919990334340192164}
- {fileID: 4435271449299454761}
m_Father: {fileID: 1420790864982329365}
m_LocalEulerAnglesHint: {x: 180, y: -0.000019318692, z: -180}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 60}
--- !u!111 &4038912821632343466
Animation:
m_ObjectHideFlags: 0
@@ -2974,6 +3117,51 @@ Transform:
- {fileID: 7973678103232626981}
m_Father: {fileID: 7919990334340192164}
m_LocalEulerAnglesHint: {x: 90, y: 31.739136, z: -90.00001}
--- !u!61 &4226566661747089
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2803447588960652519}
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: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: -0.07676768, y: -0.04192242}
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: 0.84646463, y: 0.6237895}
m_EdgeRadius: 0
--- !u!1 &3018303185921675956
GameObject:
m_ObjectHideFlags: 0
@@ -6401,184 +6589,3 @@ Transform:
- {fileID: 5771010512328704930}
m_Father: {fileID: 4473050239839178915}
m_LocalEulerAnglesHint: {x: -1.4137985, y: -2.5074775, z: 0.08318697}
--- !u!114 &8522120771046664843
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 23267125243866503}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5e5dca86a57fe2144a34f1f2ddb93962, type: 3}
m_Name:
m_EditorClassIdentifier:
beilv: 0
guid:
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
skeleton: {fileID: 0}
isSpine: 1
fishTypeID: 11004
currState: 0
HP: 5
effect_Die: {fileID: 0}
effect_DieAward: {fileID: 0}
currEffect_DieAward: {fileID: 0}
isMove: 1
is3D: 1
forwordXYZ: -Z
fishenum: 0
moveTime: 0
isyz: 0
yzID:
colliderList: []
lockPoint: {fileID: 7919990334340192164}
bingDongEffect: {fileID: 4067042857930265640}
rotationPY: 60
isRotate: 1
isNot1: 0
ischild0: 1
depthOffset: 560
--- !u!61 &4226566661747089
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2803447588960652519}
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: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: -0.07676768, y: -0.04192242}
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: 0.84646463, y: 0.6237895}
m_EdgeRadius: 0
--- !u!1 &2564128008921513
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5223238392694687}
- component: {fileID: 7416975800075197}
m_Layer: 6
m_Name: GameObject
m_TagString: Fish
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5223238392694687
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2564128008921513}
serializedVersion: 2
m_LocalRotation: {x: -0, y: 0.7071068, z: -0, w: 0.7071068}
m_LocalPosition: {x: -0.16296482, y: -0.122039795, z: 0.15131095}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1420790864982329365}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &7416975800075197
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2564128008921513}
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: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
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, y: 1}
m_EdgeRadius: 0
@@ -17,6 +17,24 @@ public enum TurretControlMode
public class SitPosData : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
public Button btn_SelectPaoBei; //点击打开关闭选择面板
public GameObject selectPaoBeiPanel; //他的出现效果是从上往下滑动的动画效果 关闭是从下往上滑动的动画效果 所称height变成0和还原那种的时间0.5s
public GameObject paobeiItemPrefab;//自己的gameobject上面有image组件和button组件 选择后直接关闭 然后他的getchild0上有个textmeshprougui 5000以下的炮倍是蓝色的 5000-10000是紫色 10000以上是红色的 黄色是选中状态的
public Transform paobeiItemParent;
public Sprite redBG;
public Sprite purpleBG;
public Sprite blueBG;
public Sprite yellowBG;
[Tooltip("自动攻击开关(由 GameMainPanel 的 toggle_SkillAuto 移植):开着=自动扫射+自动开火;关闭时本地座位炮台切回 Idle 并触发 OnAutoAttackOff")]
public Toggle toggle_AutoAttack;
/// <summary>自动攻击从开→关时触发一次(GameMainPanel 订阅后广播 Idle 状态给其他客户端,仅本地玩家座位会触发)</summary>
public event Action OnAutoAttackOff;
/// <summary>自动攻击是否开启(toggle 没拖引用时恒为 false,等同未开自动攻击)</summary>
public bool IsAutoAttackOn => toggle_AutoAttack != null && toggle_AutoAttack.isOn;
[Tooltip("长按判定时间(秒):按住 img_OpenPT 超过此时间触发 OnOpenPTLongPress")]
public float openPTLongPressTime = 0.5f;
public Image img_OpenPT;
@@ -186,6 +204,10 @@ public class SitPosData : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
if (btn_TurretMinus != null)
btn_TurretMinus.onClick.AddListener(() => ChangeTurretMinusConsumeNum());
// ⭐ 自动攻击开关:关闭时本地座位炮台切回 Idle(原 GameMainPanel 的 toggle_SkillAuto 监听逻辑)
if (toggle_AutoAttack != null)
toggle_AutoAttack.onValueChanged.AddListener(OnAutoAttackToggleChanged);
// ⭐ 散射起点球父对象兜底:预制体没拖引用就自动创建(挂 beij 下,炮台两侧),
// 保证 UpdateJGFXParentsActive 永远有对象可激活,不依赖 Inspector 配置。
// XJMH(星际迷航)没有战神/激光概念,跳过不给它加节点。
@@ -202,6 +224,20 @@ public class SitPosData : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
InitXJMHTurret();
}
/// <summary>
/// 自动攻击开关变化:关闭时本地座位炮台立即切回 Idle(自动开火停止)。
/// ⭐ 只对本地玩家座位生效:同一个 toggle 被拖到多个座位时,非本地座位不响应,
/// 避免远程座位的状态机被本地点击误切。
/// </summary>
private void OnAutoAttackToggleChanged(bool on)
{
if (on) return;
if (this != localPlayerSit) return;
ChangeState(TurretState.Idle);
OnAutoAttackOff?.Invoke();
}
/// <summary>
/// 散射起点球父对象兜底:Inspector 没拖引用时自动创建两个 RectTransform
/// (挂在 turretRotate 的父节点 beij 下,炮台左右两侧 ±50),并写回字段。
@@ -3784,11 +3784,13 @@ MonoBehaviour:
botRotateSpeed: 80
bullet_Test: {fileID: 0}
bulletParent: {fileID: 911064000014996888}
turretLongPressThreshold: 0.5
boardCast_Boss: {fileID: 0}
createVideoPlayer: {fileID: 3675753497965075354}
paoBeiList:
JinDuTiao: {fileID: 6293566698206718061}
isFrenzy: 0
laserHitDelay: 0.2
sitBulletMaxCount: 100
--- !u!1 &5910028015393800118
GameObject:
@@ -6582,13 +6584,18 @@ PrefabInstance:
- target: {fileID: 3429558903206714841, guid: 6c8512965de208f498306fbdfeb8eb5b,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3783151213167614958, guid: 6c8512965de208f498306fbdfeb8eb5b,
type: 3}
propertyPath: m_Name
value: UIGame177LoadingView
objectReference: {fileID: 0}
- target: {fileID: 3783151213167614958, guid: 6c8512965de208f498306fbdfeb8eb5b,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5494969937974881520, guid: 6c8512965de208f498306fbdfeb8eb5b,
type: 3}
propertyPath: m_AnchoredPosition.x
@@ -7110,6 +7117,21 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 8080891624328096898}
m_Modifications:
- target: {fileID: 1367620504699206675, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1367620504699206675, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1367620504699206675, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1569780968229124829, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_SortingLayer
@@ -7140,6 +7162,36 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.x
value: -3.5020447
objectReference: {fileID: 0}
- target: {fileID: 5508732527700195132, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5508732527700195132, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5508732527700195132, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5978399941642378696, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5978399941642378696, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5978399941642378696, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6916578527196273495, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Pivot.x
@@ -7240,6 +7292,21 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8016868827347822228, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8016868827347822228, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8016868827347822228, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8478292218862718469, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_SortingLayer
@@ -134,7 +134,7 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
public GameObject mySitAnim;
public Dictionary<string, Toggle> dic_Skill_Toggle = new Dictionary<string, Toggle>();//开关型技能
[Header("Skillbottom")]
public Toggle toggle_SkillAuto;
// toggle_SkillAuto(自动攻击)已移植到 SitPosData.toggle_AutoAttack:读取 currSitData.IsAutoAttackOn,关闭时座位自己切 Idle + OnAutoAttackOff 广播
public Toggle toggle_Lock;
public Toggle toggle_Three;
public Toggle toggle_Shuang;
@@ -280,6 +280,8 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
currSitData = item;
// ⭐ 长按本地座位的 img_OpenPT 开关炮台面板(与 btn_ChangeTurret 同逻辑)
HookOpenPTLongPress(currSitData);
// ⭐ 本地座位自动攻击关闭时广播 Idle 状态给其他客户端
HookAutoAttackOff(currSitData);
}
else
{
@@ -418,6 +420,7 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
// ⭐ 解绑长按 img_OpenPT 打开炮台面板的订阅
UnhookOpenPTLongPress();
UnhookAutoAttackOff();
UnLoadResources();
// 场景可能未加载或已卸载,做保护避免重复卸载报错
@@ -481,6 +484,38 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
#endregion
#region 自动攻击开关(SitPosData.toggle_AutoAttack)
/// <summary>已订阅自动攻击关闭事件的座位(换座位/重进房间时先解绑避免重复订阅)</summary>
private SitPosData _autoAttackHookedSit;
/// <summary>缓存的关闭处理器(解绑用)</summary>
private Action _autoAttackOffHandler;
/// <summary>
/// 订阅本地座位的自动攻击关闭事件:关闭时广播 Idle 状态给其他客户端
/// (座位本体的 ChangeState(Idle) 已在 SitPosData.OnAutoAttackToggleChanged 里完成)。
/// </summary>
private void HookAutoAttackOff(SitPosData sit)
{
UnhookAutoAttackOff();
if (sit == null) return;
_autoAttackOffHandler = () => SyncTurretState(TurretState.Idle);
sit.OnAutoAttackOff += _autoAttackOffHandler;
_autoAttackHookedSit = sit;
}
/// <summary>解绑自动攻击关闭事件的订阅(面板隐藏/重新订阅前调用)</summary>
private void UnhookAutoAttackOff()
{
if (_autoAttackHookedSit != null && _autoAttackOffHandler != null)
_autoAttackHookedSit.OnAutoAttackOff -= _autoAttackOffHandler;
_autoAttackHookedSit = null;
_autoAttackOffHandler = null;
}
#endregion
#region 生命周期
private float baseAttackTime;
@@ -668,15 +703,7 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
GameManager.Instance.user.id,
"40004", 0);
});
toggle_SkillAuto.onValueChanged.AddListener(on =>
{
if (!on)
{
// 自动开火关闭 → 立即切回 Idle
currSitData.ChangeState(TurretState.Idle);
SyncTurretState(TurretState.Idle);
}
});
// toggle_SkillAuto 的关闭监听(切 Idle+广播)已移植到 SitPosData.OnAutoAttackToggleChanged,面板通过 HookAutoAttackOff 订阅广播
toggle_BingFeng.onValueChanged.AddListener(on => {
if (!on)
{
@@ -1433,7 +1460,7 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
return;
}
// 自动开火关闭 → 不自动旋转
if (!toggle_SkillAuto.isOn) return;
if (!currSitData.IsAutoAttackOn) return;
// 自动扫射(左右摆动)
AutoSweepRotate();
}
@@ -1796,7 +1823,7 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
//private void HandleAutoFire()
//{
// if (!toggle_SkillAuto.isOn) return;
// if (!currSitData.IsAutoAttackOn) return;
// if (currSitData == null) return;
// autoFireTimer += Time.deltaTime;
@@ -1823,7 +1850,7 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
// ⭐ 起飞炮台:飞行/悬停期间暂停自动开火(此时由悬停逻辑自动向上发射),平时正常自动开火
if (currSitData.currentTurret is FlyTurretData flyAutoFire && flyAutoFire.IsFlying) return;
bool needAutoFire = toggle_SkillAuto.isOn || (toggle_Lock.isOn && currSitData.isLock && currSitData.lockFX.gameObject.activeSelf);
bool needAutoFire = currSitData.IsAutoAttackOn || (toggle_Lock.isOn && currSitData.isLock && currSitData.lockFX.gameObject.activeSelf);
if (!needAutoFire)
{
autoFireTimer = 0f;
@@ -2418,7 +2445,7 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
//private void HandleAutoLock()
//{
// if (!toggle_SkillAuto.isOn) return;
// if (!currSitData.IsAutoAttackOn) return;
// if (toggle_Lock.isOn) return;
// if (currSitData.isLock) return;
@@ -2607,7 +2634,7 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
isSanShe = isSanShe,
twoRTruuect = isDouble,
isSuoDing = isLock,
auto = toggle_SkillAuto.isOn
auto = currSitData.IsAutoAttackOn
};
// ⭐ 三发 + 锁定:查找 3 个优先级目标,写入 monsterIDs
+160
View File
@@ -8,6 +8,11 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 74423160475142429, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1274750478710656607, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalRotation.w
@@ -33,6 +38,31 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1302712490001513181, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1367620504699206675, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1367620504699206675, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1367620504699206675, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1488419584990204227, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1569780968229124829, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_SortingLayer
@@ -48,11 +78,36 @@ PrefabInstance:
propertyPath: m_SortingLayer
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1661374236704593025, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1792148222953556558, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1987168538874080858, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2405971011163688543, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Texture
value:
objectReference: {fileID: 8400000, guid: 1aef5e277ebf9b24a8e696a3a48ce9c8, type: 2}
- target: {fileID: 2529296075173687928, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2604713136694223528, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2665086753109955065, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Texture
@@ -88,11 +143,21 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 22.638
objectReference: {fileID: 0}
- target: {fileID: 3332759288714861708, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3474185499508581916, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_TargetTexture
value:
objectReference: {fileID: 8400000, guid: 1aef5e277ebf9b24a8e696a3a48ce9c8, type: 2}
- target: {fileID: 3688976792230592525, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3727740338450110775, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_AnchorMax.y
@@ -118,16 +183,76 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: -34.5
objectReference: {fileID: 0}
- target: {fileID: 4948902458849928676, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5103147268897560930, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5118343091601829732, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5135858785811373824, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Texture
value:
objectReference: {fileID: 8400000, guid: 76b870c22cc5b9246b4dcd74d749d6fc, type: 2}
- target: {fileID: 5508732527700195132, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5508732527700195132, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5508732527700195132, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5533000567333953537, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5663993776979783327, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5925412083069679843, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_TargetTexture
value:
objectReference: {fileID: 8400000, guid: 76b870c22cc5b9246b4dcd74d749d6fc, type: 2}
- target: {fileID: 5978399941642378696, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5978399941642378696, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5978399941642378696, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6499619463323741843, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6602789974901403781, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_TargetTexture
@@ -233,6 +358,11 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7006284038471683348, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7037324096053784830, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalRotation.w
@@ -268,6 +398,31 @@ PrefabInstance:
propertyPath: posID
value: 2
objectReference: {fileID: 0}
- target: {fileID: 7404435721353591779, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8016868827347822228, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8016868827347822228, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8016868827347822228, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8288222949658198362, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8303575886087428388, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_LocalRotation.w
@@ -323,6 +478,11 @@ PrefabInstance:
propertyPath: m_SortingLayer
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9220805719769108438, guid: c9c177e60fd350e49844955f7e8a5874,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
File diff suppressed because it is too large Load Diff
@@ -15301,16 +15301,21 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 8089897460392818443}
m_Modifications:
- target: {fileID: 310515316105668945, guid: fa8b75719d4e08c40a788ca49fe54755,
type: 3}
propertyPath: initialSkinName
value:
objectReference: {fileID: 0}
- target: {fileID: 310515316105668945, guid: fa8b75719d4e08c40a788ca49fe54755,
type: 3}
propertyPath: skeletonDataAsset
value:
objectReference: {fileID: 11400000, guid: 03f212b1acce12742aa3c78f4fc77b86,
objectReference: {fileID: 11400000, guid: 785d5de6ff10071429e202e9ee19d700,
type: 2}
- target: {fileID: 310515316105668945, guid: fa8b75719d4e08c40a788ca49fe54755,
type: 3}
propertyPath: startingAnimation
value: animation
value: idle1
objectReference: {fileID: 0}
- target: {fileID: 310515316105668945, guid: fa8b75719d4e08c40a788ca49fe54755,
type: 3}
@@ -15325,12 +15330,22 @@ PrefabInstance:
- target: {fileID: 5993261829150408421, guid: fa8b75719d4e08c40a788ca49fe54755,
type: 3}
propertyPath: m_LocalScale.x
value: 0.08
value: 0.099999994
objectReference: {fileID: 0}
- target: {fileID: 5993261829150408421, guid: fa8b75719d4e08c40a788ca49fe54755,
type: 3}
propertyPath: m_LocalScale.y
value: 0.08
value: 0.099999994
objectReference: {fileID: 0}
- target: {fileID: 5993261829150408421, guid: fa8b75719d4e08c40a788ca49fe54755,
type: 3}
propertyPath: m_LocalScale.z
value: 0.12500001
objectReference: {fileID: 0}
- target: {fileID: 5993261829150408421, guid: fa8b75719d4e08c40a788ca49fe54755,
type: 3}
propertyPath: m_ConstrainProportionsScale
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6464046321297487490, guid: fa8b75719d4e08c40a788ca49fe54755,
type: 3}
@@ -16555,17 +16570,17 @@ PrefabInstance:
- target: {fileID: 3992753865219481776, guid: 998111e312f018648b7c9f2e0c1ed8fa,
type: 3}
propertyPath: m_LocalScale.x
value: 0.15
value: 0.17
objectReference: {fileID: 0}
- target: {fileID: 3992753865219481776, guid: 998111e312f018648b7c9f2e0c1ed8fa,
type: 3}
propertyPath: m_LocalScale.y
value: 0.15
value: 0.17
objectReference: {fileID: 0}
- target: {fileID: 3992753865219481776, guid: 998111e312f018648b7c9f2e0c1ed8fa,
type: 3}
propertyPath: m_LocalScale.z
value: 0.08823531
value: 0.10000002
objectReference: {fileID: 0}
- target: {fileID: 3992753865219481776, guid: 998111e312f018648b7c9f2e0c1ed8fa,
type: 3}
+183 -3
View File
@@ -106,6 +106,32 @@ TextureImporter:
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
@@ -118,7 +144,7 @@ TextureImporter:
width: 198
height: 57
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -139,7 +165,7 @@ TextureImporter:
width: 198
height: 57
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -160,7 +186,7 @@ TextureImporter:
width: 196
height: 57
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -172,6 +198,153 @@ TextureImporter:
indices:
edges: []
weights: []
- serializedVersion: 2
name: BY_PlaneInfoPanel2_3
rect:
serializedVersion: 2
x: 451
y: 468
width: 333
height: 495
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 43, y: 29, z: 45, w: 72}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 9413fd540c73ea14192b0fd71f338d48
internalID: 1010707729
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: BY_PlaneInfoPanel2_4
rect:
serializedVersion: 2
x: 1170
y: 943
width: 77
height: 66
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: caf3f9ffe486a26438dfdc5ab313c877
internalID: -1227233253
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: BY_PlaneInfoPanel2_5
rect:
serializedVersion: 2
x: 1969
y: 744
width: 77
height: 70
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: b7dbb2e334fe60041853a333e810935e
internalID: -95983641
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: BY_PlaneInfoPanel2_6
rect:
serializedVersion: 2
x: 1040
y: 378
width: 268
height: 82
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 44f348a0d17bf004ca77888c3aa690e2
internalID: -1986444538
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: BY_PlaneInfoPanel2_7
rect:
serializedVersion: 2
x: 1491
y: 311
width: 268
height: 82
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: a86da5d72284d6e46bdb89b396d9c916
internalID: 1178140535
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: BY_PlaneInfoPanel2_8
rect:
serializedVersion: 2
x: 1761
y: 311
width: 268
height: 82
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: ffc130ae732cda440ac39bdc6b330f1c
internalID: -1283488398
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: BY_PlaneInfoPanel2_9
rect:
serializedVersion: 2
x: 1491
y: 226
width: 268
height: 82
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: ec820b0cb24b608468ac5adbb3d185b7
internalID: -228299768
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape: []
bones: []
@@ -186,6 +359,13 @@ TextureImporter:
BY_PlaneInfoPanel2_0: 922454153
BY_PlaneInfoPanel2_1: -324967931
BY_PlaneInfoPanel2_2: -1244155469
BY_PlaneInfoPanel2_3: 1010707729
BY_PlaneInfoPanel2_4: -1227233253
BY_PlaneInfoPanel2_5: -95983641
BY_PlaneInfoPanel2_6: -1986444538
BY_PlaneInfoPanel2_7: 1178140535
BY_PlaneInfoPanel2_8: -1283488398
BY_PlaneInfoPanel2_9: -228299768
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData: