添加过程中拼刺刀完整版,添加湖南株洲万达神农城潮玩社场景

This commit is contained in:
ZYT
2025-12-23 11:47:33 +08:00
parent 0a42668d34
commit 0da478bf50
11 changed files with 242668 additions and 19 deletions

View File

@@ -3793,7 +3793,7 @@ Transform:
m_GameObject: {fileID: 386243493}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068}
m_LocalPosition: {x: 13.42, y: 0, z: 3.59}
m_LocalPosition: {x: 12.43, y: 0, z: 3.47}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
@@ -9370,7 +9370,7 @@ MonoBehaviour:
IncludeChildColliders: 0
RuntimeFollower: {fileID: 0}
colliderMaxDistance: 100
lastTimeMaxDistanceCalced: 639012212281030474
lastTimeMaxDistanceCalced: 639020826570283881
--- !u!82 &675942809
AudioSource:
m_ObjectHideFlags: 0

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1310aa8f4f0061241b762cc3ee296e27
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -173,7 +173,7 @@ public class GameManager : NetworkBehaviour
[SyncVar]
public long vistEnd = 0;
// 总游玩时长
private int vistAllTime = (int)(60*2);//开启最后拼刺刀模式
private int vistAllTime = (int)(60*7);//开启最后拼刺刀模式
[SyncVar]
public string settleData = "";
@@ -575,19 +575,45 @@ public class GameManager : NetworkBehaviour
}
else
{
// 修复:检查 AiInfos[1] 是否存在
if (AiInfos.ContainsKey(1))
// 非指定场地也需要防重叠
int posId = Mathf.Clamp(i / 3, 0, enemyStartPosCount - 1);
Vector3 basePosition = GameLocal.Ins.enemyStartPos[posId].position;
// 在基础位置上添加随机偏移
Vector3 randomOffset = new Vector3(
Random.Range(-1.5f, 1.5f),
0,
Random.Range(-1.5f, 1.5f)
);
Vector3 spawnPosition = basePosition + randomOffset;
// 检查位置是否有效
bool positionValid = true;
foreach (var existingEnemy in EnemyList.Values)
{
playerAi.transform.position = GameLocal.Ins.endPlayerStartPos.position;
playerAi.transform.eulerAngles = AiInfos[1].EulerAngles;
if (Vector3.Distance(spawnPosition, existingEnemy.transform.position) < 0.8f)
{
positionValid = false;
break;
}
}
else
// 如果位置无效,尝试另一个偏移
if (!positionValid)
{
Debug.LogError("AiInfos 中不存在键为 1 的条目无法设置玩家AI的欧拉角");
// 使用默认位置和角度
playerAi.transform.position = GameLocal.Ins.endPlayerStartPos?.position ?? Vector3.zero;
playerAi.transform.eulerAngles = Vector3.zero;
randomOffset = new Vector3(
Random.Range(-2.0f, 2.0f),
0,
Random.Range(-2.0f, 2.0f)
);
spawnPosition = basePosition + randomOffset;
}
enemy.transform.position = spawnPosition;
int targetPosId = Mathf.Clamp(i / 3, 0, enemyEndPosCount - 1);
enemy.transform.eulerAngles = targetPos[targetPosId].eulerAngles;
}
PlayerAI playerAI = playerAi.GetComponent<PlayerAI>();
@@ -675,7 +701,7 @@ public class GameManager : NetworkBehaviour
{
if(!isStart|| gameState== GameState.EndEvent)
return;
GetRoundEnemy();
if(isPkEvent ==true )
{
SetGameState(GameState.PKEvent );
@@ -685,7 +711,7 @@ public class GameManager : NetworkBehaviour
SetGameState(GameState.Playing );
}
GetRoundEnemy();
}, roundWaveTime);
}
@@ -838,7 +864,6 @@ public class GameManager : NetworkBehaviour
if (isPk)
{
isPkEvent = true;
gameState = GameState.PKEvent;
PlayEndEvent(false);
}
else