fix:调整鱼的路线,调整漂流瓶
This commit is contained in:
@@ -1 +1 @@
|
||||
Build from CHINAMI-UKDLSK3 at 2026/2/25 11:58:14
|
||||
Build from CHINAMI-UKDLSK3 at 2026/2/25 14:06:27
|
||||
Binary file not shown.
@@ -339,7 +339,7 @@ ParticleSystem:
|
||||
m_RotationOrder: 4
|
||||
ShapeModule:
|
||||
serializedVersion: 6
|
||||
enabled: 1
|
||||
enabled: 0
|
||||
type: 13
|
||||
angle: 25
|
||||
length: 5
|
||||
@@ -2685,7 +2685,6 @@ GameObject:
|
||||
- component: {fileID: 692078838862573146}
|
||||
- component: {fileID: 4070160425390736200}
|
||||
- component: {fileID: 4688687031720158021}
|
||||
- component: {fileID: 2623099541515372069}
|
||||
- component: {fileID: 6043703699465387595}
|
||||
m_Layer: 23
|
||||
m_Name: DriftBottle
|
||||
@@ -2707,8 +2706,8 @@ Transform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 4319099661105096217}
|
||||
- {fileID: 6156551554595862101}
|
||||
- {fileID: 4319099661105096217}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!54 &692078838862573146
|
||||
@@ -2777,18 +2776,7 @@ MonoBehaviour:
|
||||
moveSpeed: 1.5
|
||||
swimAmplitude: 0.1
|
||||
swimFrequency: 2
|
||||
--- !u!114 &2623099541515372069
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9027730758956716971}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a79a7ebf917bd714fa8ba7fa6ce2e832, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
controller: {fileID: 6043703699465387595}
|
||||
--- !u!114 &6043703699465387595
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -30,7 +30,7 @@ public class Fish : MonoBehaviour
|
||||
public FishState state = FishState.Alive;
|
||||
private bool unregisterCalled = false;
|
||||
|
||||
private void Start()
|
||||
public virtual void Start()
|
||||
{
|
||||
modelRoot = transform.GetChild(0);
|
||||
}
|
||||
|
||||
@@ -36,8 +36,10 @@ public class SharkFish : Fish
|
||||
Attacking, // 攻击玩家
|
||||
Retreating // 撤退
|
||||
}
|
||||
void Start()
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
player = GameManager.Ins.player.transform;
|
||||
currentState = SharkState.Patrolling;
|
||||
// 攻击间隔改为20-30秒随机
|
||||
|
||||
@@ -548,10 +548,10 @@ public class GameManager : MonoBehaviour
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Space))
|
||||
{
|
||||
GameInit.Ins.self.AddCoin(5000);
|
||||
//GameInit.Ins.self.AddCoin(5000);
|
||||
//GameInit.Ins.self.AddScore(10000);
|
||||
//WinEndGame();
|
||||
//StartFishTideEvent();
|
||||
StartFishTideEvent();
|
||||
//StartDriftBottleEvent();
|
||||
}
|
||||
if (fishSpawner.GetFishCount(FishType.AngelHorse) >= 1)
|
||||
@@ -612,7 +612,7 @@ public class GameManager : MonoBehaviour
|
||||
spawnPosition.y = 0f; // 高度设为0
|
||||
|
||||
// 面朝右边(玩家右侧方向)
|
||||
Quaternion spawnRotation = Quaternion.LookRotation(playerRight);
|
||||
Quaternion spawnRotation = Quaternion.LookRotation(-playerRight);
|
||||
|
||||
Instantiate(fishTidePre, spawnPosition, spawnRotation);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class DriftBottle : MonoBehaviour
|
||||
public float swimFrequency = 2f; // 游动频率
|
||||
|
||||
// 私有变量
|
||||
private SplineController controller;
|
||||
public SplineController controller;
|
||||
private DriftBottleState state = DriftBottleState.Alive;
|
||||
private int fragmentIndex; // 碎片序号(0-29)
|
||||
private int statueIndex; // 所属雕像(0-2)
|
||||
@@ -61,7 +61,7 @@ public class DriftBottle : MonoBehaviour
|
||||
{
|
||||
fragmentIndex = fragIndex;
|
||||
statueIndex = statIdx;
|
||||
|
||||
state = DriftBottleState.Alive;
|
||||
// 检查路径是否有效
|
||||
if (spline == null)
|
||||
{
|
||||
@@ -69,24 +69,12 @@ public class DriftBottle : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
// 设置移动控制器
|
||||
controller = GetComponent<SplineController>();
|
||||
if (controller == null)
|
||||
controller = gameObject.AddComponent<SplineController>();
|
||||
|
||||
// 禁用控制器以便设置参数
|
||||
controller.enabled = false;
|
||||
|
||||
// 设置路径参数
|
||||
controller.Spline = spline;
|
||||
controller.Speed = moveSpeed;
|
||||
controller.Position = 0;
|
||||
controller.MoveMode = SplineController.MoveModeEnum.Relative;
|
||||
controller.PlayAutomatically = false;
|
||||
|
||||
// 重新启用控制器
|
||||
controller.enabled = true;
|
||||
|
||||
// 开始移动
|
||||
controller.Play();
|
||||
|
||||
@@ -100,7 +88,7 @@ public class DriftBottle : MonoBehaviour
|
||||
Debug.Log($"[DriftBottle] 初始化完成,路径:{spline.name},速度:{moveSpeed}");
|
||||
|
||||
// 根据碎片序号显示不同外观(可选)
|
||||
UpdateAppearance();
|
||||
//UpdateAppearance();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
|
||||
@@ -180,7 +180,7 @@ public class DriftBottleManager : MonoBehaviour
|
||||
Debug.Log("[DriftBottleManager] 海底雕像事件已启动!");
|
||||
|
||||
// 立即生成第一波
|
||||
TrySpawnBottles();
|
||||
//TrySpawnBottles();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -223,9 +223,6 @@ public class DriftBottleManager : MonoBehaviour
|
||||
Debug.LogError("[DriftBottleManager] 没有可用的路径!");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log($"[DriftBottleManager] 生成{spawnCount}个漂流瓶");
|
||||
|
||||
// 生成漂流瓶,分散在不同路径
|
||||
for (int i = 0; i < spawnCount; i++)
|
||||
{
|
||||
|
||||
@@ -269,9 +269,6 @@ public class DriftBottlePathGenerator : MonoBehaviour
|
||||
|
||||
// 将路径对象移动到第一个控制点位置
|
||||
pathObj.transform.position = startPoint;
|
||||
|
||||
Debug.Log($"[DriftBottlePathGenerator] 生成随机路径: 水平角度{horizontalAngle:F1}°, 垂直角度{verticalAngle:F1}°, 起点{startPoint}, 终点{endPoint}");
|
||||
|
||||
return spline;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user