fix:解决支援敌人没死亡问题

This commit is contained in:
bzx
2025-09-30 16:08:20 +08:00
parent eb9cdfe194
commit 6d754a635a
10 changed files with 268680 additions and 29 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4e7d4438584a5a74fbb557c831c241fa
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -245676,7 +245676,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 2147483647
m_IsActive: 1
m_IsActive: 0
--- !u!1 &5058877844344015996
GameObject:
m_ObjectHideFlags: 0
@@ -280245,7 +280245,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 2147483647
m_IsActive: 1
m_IsActive: 0
--- !u!199 &5542860896317610718
ParticleSystemRenderer:
serializedVersion: 6
@@ -411773,7 +411773,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 2147483647
m_IsActive: 1
m_IsActive: 0
--- !u!23 &8587359420486724025
MeshRenderer:
m_ObjectHideFlags: 0
@@ -436774,7 +436774,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 2147483647
m_IsActive: 1
m_IsActive: 0
--- !u!198 &8982537013120260763
ParticleSystem:
m_ObjectHideFlags: 0

View File

@@ -74,9 +74,9 @@ public class PlayerAIAnimator : MonoBehaviour
}
public void Die()
{
if(playerAI.isServer)
GameManager.Ins.DeleteEnemy(playerAI.id,transform);
}
// public void Die()
// {
// if(playerAI.isServer)
// //GameManager.Ins.DeleteEnemy(playerAI.id,transform);
// }
}

View File

@@ -76,8 +76,10 @@ public class EnemyAIAnimator : MonoBehaviour
public void Die()
{
if(enemyAI.isServer)
GameManager.Ins.DeleteEnemy(enemyAI.id,transform);
if (enemyAI.isServer)
{
GameManager.Ins.DeleteEnemy(enemyAI.id,enemyAI.lvl==-1);
}
}
public void CreateItem()

View File

@@ -508,8 +508,8 @@ public class GameManager : NetworkBehaviour
int curRoundIndex=Random.Range(1,RoundInfos.Count);
var roundInfo=roundIndex <= 2? RoundInfos[0]: RoundInfos[curRoundIndex];
// curRoundIndex=2;
// roundInfo= RoundInfos[curRoundIndex];
curRoundIndex=5;
roundInfo= RoundInfos[curRoundIndex];
roundIndex = curRoundIndex;
StartEvent(roundInfo);
@@ -748,7 +748,7 @@ public class GameManager : NetworkBehaviour
var enemy = Instantiate(EnemyPres[0], enemyPos, Quaternion.identity);
NetworkServer.Spawn(enemy);
enemy.GetComponent<Enemy>().OnSpawn(j, 3, 1, GameLocal.Ins.npcPos[posId].position);
enemy.GetComponent<Enemy>().OnSpawn(-j, 3, -1, GameLocal.Ins.npcPos[posId].position);
enemy.GetComponent<Enemy>().outline.enabled = true;
NpcEnemyList.Add(enemy.GetComponent<Enemy>());
}
@@ -815,14 +815,22 @@ public class GameManager : NetworkBehaviour
/// 删除敌方单位
/// </summary>
[Server]
public void DeleteEnemy(int id,Transform pos)
public void DeleteEnemy(int id,bool isNpcEnemy)
{
if (isNpcEnemy)
{
foreach (var item in NpcEnemyList)
{
if (item.id == id)
{
NpcEnemyList.Remove(item);
NetworkServer.Destroy(item.gameObject);
return;
}
}
return;
}
GameObject enemy = EnemyList[id].gameObject;
int hpItemPropIndex = 15;
int randomItemPropIndex = Random.Range(1, 101);
if(randomItemPropIndex<hpItemPropIndex)
CreateItemProp(enemy.transform);
EnemyList.Remove(id);

View File

@@ -6,9 +6,9 @@ ModelImporter:
externalObjects: {}
materials:
materialImportMode: 2
materialName: 1
materialName: 0
materialSearch: 1
materialLocation: 0
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0

View File

@@ -86,10 +86,10 @@ Shader "Hovl/Particles/Distortion"
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( i );
#ifdef SOFTPARTICLES_ON
float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)));
float partZ = i.projPos.z;
float fade = saturate (_InvFade * (sceneZ-partZ));
i.color.a *= fade;
// float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)));
// float partZ = i.projPos.z;
// float fade = saturate (_InvFade * (sceneZ-partZ));
// i.color.a *= fade;
#endif
half3 tex2DNode14 = UnpackNormal(tex2D( _NormalMap, i.texcoord2));