1
This commit is contained in:
@@ -1148,9 +1148,9 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
|
||||
StartCoroutine(IeShanXing(createFishData, yz, pos, prefab, pathList, time, yz.fishCount, arraySeq));
|
||||
break;
|
||||
|
||||
case "701": // 环形阵:同帧同路径全部生成
|
||||
foreach (int pathId in pathList)
|
||||
Quan(createFishData, yz, pos, prefab, pathId, yz.fishCount, time, arraySeq);
|
||||
case "701": // 环形阵:同帧同路径全部生成(无延迟)
|
||||
for (int li = 0; li < pathList.Count; li++)
|
||||
Quan(createFishData, yz, pos, prefab, pathList[li], yz.fishCount, time, arraySeq, li);
|
||||
break;
|
||||
|
||||
case "702":
|
||||
@@ -1179,23 +1179,23 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
|
||||
// 鱼阵生成协程 / 方法
|
||||
// ================================================================
|
||||
|
||||
/// <summary>扇形阵:按路线列表逐条延迟 0.8s 生成一扇。</summary>
|
||||
/// <summary>扇形阵:按路线列表逐条延迟 1s 生成一扇。</summary>
|
||||
private IEnumerator IeShanXing(FrameData_CreateFish createFishData, FishArrayConfig yz,
|
||||
Vector3 pos, GameObject prefab, List<int> pathList, long time, int count, int arraySeq)
|
||||
{
|
||||
foreach (int pathId in pathList)
|
||||
for (int lineIndex = 0; lineIndex < pathList.Count; lineIndex++)
|
||||
{
|
||||
if (!isResources)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
ShanXing(createFishData, yz, pos, prefab, pathId, count, time, arraySeq);
|
||||
yield return new WaitForSeconds(0.8f);
|
||||
ShanXing(createFishData, yz, pos, prefab, pathList[lineIndex], count, time, arraySeq, lineIndex);
|
||||
yield return new WaitForSeconds(1f);
|
||||
}
|
||||
}
|
||||
|
||||
private void ShanXing(FrameData_CreateFish createFishData, FishArrayConfig yz,
|
||||
Vector3 pos, GameObject prefab, int pathId, int count, long time, int arraySeq)
|
||||
Vector3 pos, GameObject prefab, int pathId, int count, long time, int arraySeq, int lineIndex)
|
||||
{
|
||||
var cfg = spawnDic[createFishData.fishNumber];
|
||||
|
||||
@@ -1223,9 +1223,9 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
|
||||
var mc = fish.GetComponent<MonsterContral>();
|
||||
|
||||
mc.monsterData.fishTypeConfig = FishDatas[yz.fishNumber];
|
||||
// ⭐ guid 用 arraySeq 替代 pathId:arraySeq 每次鱼阵递增,全局唯一,
|
||||
// 防止 pathList 重复 pathId 或同 fishId 多次推送导致 guid 冲突
|
||||
mc.guid = createFishData.guid + "_" + arraySeq + "_" + i;
|
||||
// ⭐ guid 用 arraySeq + lineIndex 替代 pathId:arraySeq 每次鱼阵递增,lineIndex 为线列表下标,
|
||||
// 两者组合全局唯一,防止 pathList 重复 pathId(如[1,1,1,1,1])导致 guid 冲突旧鱼被回收
|
||||
mc.guid = createFishData.guid + "_" + arraySeq + "_" + lineIndex + "_" + i;
|
||||
RegisterFishInstance(mc, FishDatas[yz.fishNumber].fishType);
|
||||
|
||||
mc.moveTime = (BeijingTimeManager.Instance.CurrentTimestampMs - time) / 1000f;
|
||||
@@ -1242,7 +1242,7 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
|
||||
/// 环形阵:在同一路径上生成 count 条鱼,角度均匀分布(360/count)。
|
||||
/// </summary>
|
||||
private void Quan(FrameData_CreateFish createFishData, FishArrayConfig yz,
|
||||
Vector3 pos, GameObject prefab, int pathId, int count, long time, int arraySeq)
|
||||
Vector3 pos, GameObject prefab, int pathId, int count, long time, int arraySeq, int lineIndex)
|
||||
{
|
||||
if (count <= 0) return;
|
||||
var cfg = spawnDic[createFishData.fishNumber];
|
||||
@@ -1261,9 +1261,9 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
|
||||
var mc = fish.GetComponent<MonsterContral>();
|
||||
|
||||
mc.monsterData.fishTypeConfig = FishDatas[yz.fishNumber];
|
||||
// ⭐ guid 用 arraySeq 替代 pathId:arraySeq 每次鱼阵递增,全局唯一,
|
||||
// 防止 pathList 重复 pathId 或同 fishId 多次推送导致 guid 冲突
|
||||
mc.guid = createFishData.guid + "_" + arraySeq + "_" + i;
|
||||
// ⭐ guid 用 arraySeq + lineIndex 替代 pathId:arraySeq 每次鱼阵递增,lineIndex 为线列表下标,
|
||||
// 两者组合全局唯一,防止 pathList 重复 pathId(如[1,1,1,1,1])导致 guid 冲突旧鱼被回收
|
||||
mc.guid = createFishData.guid + "_" + arraySeq + "_" + lineIndex + "_" + i;
|
||||
RegisterFishInstance(mc, FishDatas[yz.fishNumber].fishType);
|
||||
|
||||
mc.moveTime = (BeijingTimeManager.Instance.CurrentTimestampMs - time) / 1000f;
|
||||
|
||||
Reference in New Issue
Block a user