增加收获属性逻辑,优化掉落物表现效果
This commit is contained in:
+21
-26
@@ -16,30 +16,22 @@ namespace SepCore.Simulation
|
||||
|
||||
public void OnLateUpdate()
|
||||
{
|
||||
if (_world == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var enemyManager = GameEntry.EnemyManager;
|
||||
if (enemyManager != null && enemyManager.Enemies != null)
|
||||
var enemies = enemyManager.Enemies;
|
||||
foreach (var enemy in enemies)
|
||||
{
|
||||
var enemies = enemyManager.Enemies;
|
||||
foreach (var enemy in enemies)
|
||||
if (enemy is not EnemyBase enemyEntity || !enemyEntity.Available)
|
||||
{
|
||||
if (enemy is not EnemyBase enemyEntity || !enemyEntity.Available)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!_world._enemies.TryGetSimulationIndex(enemyEntity.Id, out int simulationIndex))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
EnemyTransformSim enemyData = _world._enemies.Transform[simulationIndex];
|
||||
ApplyEnemyPresentation(enemyEntity, in enemyData);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!_world._enemies.TryGetSimulationIndex(enemyEntity.Id, out int simulationIndex))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
EnemyTransformSim enemyData = _world._enemies.Transform[simulationIndex];
|
||||
ApplyEnemyPresentation(enemyEntity, in enemyData);
|
||||
}
|
||||
|
||||
var projectiles = _world._projectiles;
|
||||
@@ -69,7 +61,15 @@ namespace SepCore.Simulation
|
||||
continue;
|
||||
}
|
||||
|
||||
pickupEntity.CachedTransform.position = ToVector3(pickups.Transform[i].Position);
|
||||
PickupTransformSim transformData = pickups.Transform[i];
|
||||
Transform pickupTransform = pickupEntity.CachedTransform;
|
||||
pickupTransform.position = ToVector3(transformData.Position);
|
||||
Vector3 forward = ToVector3(transformData.Forward);
|
||||
forward.y = 0f;
|
||||
if (forward.sqrMagnitude > float.Epsilon)
|
||||
{
|
||||
pickupTransform.rotation = Quaternion.LookRotation(forward.normalized, Vector3.up);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,11 +99,6 @@ namespace SepCore.Simulation
|
||||
in ProjectileTransformSim projectileData)
|
||||
{
|
||||
Transform projectileTransform = projectileEntity.CachedTransform;
|
||||
if (projectileTransform == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
projectileTransform.position = ToVector3(projectileData.Position);
|
||||
Vector3 forward = ToVector3(projectileData.Forward);
|
||||
if (forward.sqrMagnitude <= float.Epsilon)
|
||||
|
||||
Reference in New Issue
Block a user