增加收获属性逻辑,优化掉落物表现效果
This commit is contained in:
+62
-25
@@ -12,30 +12,72 @@ namespace SepCore.Simulation
|
||||
private float _playerAbsorbRange = -1f;
|
||||
private float _playerAbsorbSpeed = -1f;
|
||||
private float _playerCollectDistance = -1f;
|
||||
private float _playerRecoilDistance = -1f;
|
||||
private float _playerRecoilDuration = -1f;
|
||||
private float _playerDashAccelerationDuration = -1f;
|
||||
private float _playerDashMaxSpeedMultiplier = -1f;
|
||||
private float _playerTurnSpeed = -1f;
|
||||
|
||||
public void SyncPlayerAbsorbSettings(float absorbRange, float absorbSpeed, float collectDistance)
|
||||
public void SyncPlayerAbsorbSettings(float absorbRange, float absorbSpeed, float collectDistance,
|
||||
float recoilDistance, float recoilDuration, float dashAccelerationDuration,
|
||||
float dashMaxSpeedMultiplier, float turnSpeed)
|
||||
{
|
||||
_playerAbsorbRange = absorbRange;
|
||||
_playerAbsorbSpeed = absorbSpeed;
|
||||
_playerCollectDistance = collectDistance;
|
||||
_playerRecoilDistance = recoilDistance;
|
||||
_playerRecoilDuration = recoilDuration;
|
||||
_playerDashAccelerationDuration = dashAccelerationDuration;
|
||||
_playerDashMaxSpeedMultiplier = dashMaxSpeedMultiplier;
|
||||
_playerTurnSpeed = turnSpeed;
|
||||
}
|
||||
|
||||
private float ResolveAbsorbRange()
|
||||
{
|
||||
if (_playerAbsorbRange >= 0f) return _playerAbsorbRange;
|
||||
return GameEntry.Luban != null ? GameEntry.Luban.Global.DefaultAbsorbRange : 2f;
|
||||
return GameEntry.Luban.Global.DefaultAbsorbRange;
|
||||
}
|
||||
|
||||
private float ResolveAbsorbSpeed()
|
||||
{
|
||||
if (_playerAbsorbSpeed >= 0f) return _playerAbsorbSpeed;
|
||||
return GameEntry.Luban != null ? GameEntry.Luban.Global.AbsorbSpeed : 8f;
|
||||
return GameEntry.Luban.Global.AbsorbSpeed;
|
||||
}
|
||||
|
||||
private float ResolveCollectDistance()
|
||||
{
|
||||
if (_playerCollectDistance >= 0f) return _playerCollectDistance;
|
||||
return GameEntry.Luban != null ? GameEntry.Luban.Global.CollectDistance : 0.5f;
|
||||
return GameEntry.Luban.Global.CollectDistance;
|
||||
}
|
||||
|
||||
private float ResolveRecoilDistance()
|
||||
{
|
||||
if (_playerRecoilDistance >= 0f) return _playerRecoilDistance;
|
||||
return GameEntry.Luban.Global.RecoilDistance;
|
||||
}
|
||||
|
||||
private float ResolveRecoilDuration()
|
||||
{
|
||||
if (_playerRecoilDuration >= 0f) return _playerRecoilDuration;
|
||||
return GameEntry.Luban.Global.RecoilDuration;
|
||||
}
|
||||
|
||||
private float ResolveDashAccelerationDuration()
|
||||
{
|
||||
if (_playerDashAccelerationDuration >= 0f) return _playerDashAccelerationDuration;
|
||||
return GameEntry.Luban.Global.DashAccelerationDuration;
|
||||
}
|
||||
|
||||
private float ResolveDashMaxSpeedMultiplier()
|
||||
{
|
||||
if (_playerDashMaxSpeedMultiplier >= 0f) return _playerDashMaxSpeedMultiplier;
|
||||
return GameEntry.Luban.Global.DashMaxSpeedMultiplier;
|
||||
}
|
||||
|
||||
private float ResolveTurnSpeed()
|
||||
{
|
||||
if (_playerTurnSpeed >= 0f) return _playerTurnSpeed;
|
||||
return GameEntry.Luban.Global.TurnSpeed;
|
||||
}
|
||||
|
||||
[Header("敌人互斥参数")]
|
||||
@@ -146,8 +188,14 @@ namespace SepCore.Simulation
|
||||
float absorbRange = ResolveAbsorbRange();
|
||||
float absorbSpeed = ResolveAbsorbSpeed();
|
||||
float collectDistance = ResolveCollectDistance();
|
||||
float recoilDistance = ResolveRecoilDistance();
|
||||
float recoilDuration = ResolveRecoilDuration();
|
||||
float dashAccelerationDuration = ResolveDashAccelerationDuration();
|
||||
float dashMaxSpeedMultiplier = ResolveDashMaxSpeedMultiplier();
|
||||
float turnSpeed = ResolveTurnSpeed();
|
||||
pickupMovementHandle = PickupMovementSystem.Schedule(_pickups, _collectedPickups, context.DeltaTime,
|
||||
planarPlayerPosition, absorbRange, absorbSpeed, collectDistance, default);
|
||||
planarPlayerPosition, absorbRange, absorbSpeed, collectDistance, recoilDistance,
|
||||
recoilDuration, dashAccelerationDuration, dashMaxSpeedMultiplier, turnSpeed, default);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,20 +280,12 @@ namespace SepCore.Simulation
|
||||
}
|
||||
else
|
||||
{
|
||||
var entityComponent = GameEntry.Entity;
|
||||
if (entityComponent != null)
|
||||
{
|
||||
entityComponent.HideEntity(drop);
|
||||
}
|
||||
GameEntry.Entity.HideEntity(drop);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var entityComponent = GameEntry.Entity;
|
||||
if (entityComponent != null)
|
||||
{
|
||||
entityComponent.HideEntity(entity);
|
||||
}
|
||||
GameEntry.Entity.HideEntity(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,19 +304,16 @@ namespace SepCore.Simulation
|
||||
}
|
||||
|
||||
var entityComponent = GameEntry.Entity;
|
||||
if (entityComponent != null && GameEntry.Luban != null)
|
||||
var group = entityComponent.GetEntityGroup(GameEntry.Luban.Global.PlayerGroupName);
|
||||
if (group != null && group.EntityCount > 0)
|
||||
{
|
||||
var group = entityComponent.GetEntityGroup(GameEntry.Luban.Global.PlayerGroupName);
|
||||
if (group != null && group.EntityCount > 0)
|
||||
var entities = group.GetAllEntities();
|
||||
for (int i = 0; i < entities.Length; i++)
|
||||
{
|
||||
var entities = group.GetAllEntities();
|
||||
for (int i = 0; i < entities.Length; i++)
|
||||
if (entities[i] is UnityGameFramework.Runtime.Entity ugfEntity &&
|
||||
ugfEntity.Logic is Player player && player.Available)
|
||||
{
|
||||
if (entities[i] is UnityGameFramework.Runtime.Entity ugfEntity &&
|
||||
ugfEntity.Logic is Player player && player.Available)
|
||||
{
|
||||
return player;
|
||||
}
|
||||
return player;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user