增加收获属性逻辑,优化掉落物表现效果
This commit is contained in:
+22
-5
@@ -290,6 +290,7 @@ namespace SepCore.Simulation
|
||||
{
|
||||
EntityId = entityId,
|
||||
Position = ToVector3(transform.Position),
|
||||
Forward = ToVector3(transform.Forward),
|
||||
PickupRadius = radius.Radius,
|
||||
State = state.State
|
||||
};
|
||||
@@ -302,9 +303,9 @@ namespace SepCore.Simulation
|
||||
|
||||
return _pickups.Add(
|
||||
new PickupIdentitySim { EntityId = simData.EntityId },
|
||||
new PickupTransformSim { Position = ToFloat3(simData.Position) },
|
||||
new PickupTransformSim { Position = ToFloat3(simData.Position), Forward = ToFloat3(simData.Forward) },
|
||||
new PickupRadiusSim { Radius = simData.PickupRadius },
|
||||
new PickupStateSim { State = simData.State });
|
||||
new PickupStateSim { State = simData.State, FloatBaseHeight = simData.Position.y });
|
||||
}
|
||||
|
||||
internal int UpsertPickup(in PickupSimData simData)
|
||||
@@ -315,9 +316,17 @@ namespace SepCore.Simulation
|
||||
}
|
||||
|
||||
_pickups.Identity[index] = new PickupIdentitySim { EntityId = simData.EntityId };
|
||||
_pickups.Transform[index] = new PickupTransformSim { Position = ToFloat3(simData.Position) };
|
||||
_pickups.Transform[index] = new PickupTransformSim
|
||||
{
|
||||
Position = ToFloat3(simData.Position),
|
||||
Forward = ToFloat3(simData.Forward)
|
||||
};
|
||||
_pickups.Radius[index] = new PickupRadiusSim { Radius = simData.PickupRadius };
|
||||
_pickups.State[index] = new PickupStateSim { State = simData.State };
|
||||
_pickups.State[index] = new PickupStateSim
|
||||
{
|
||||
State = simData.State,
|
||||
FloatBaseHeight = simData.Position.y
|
||||
};
|
||||
return index;
|
||||
}
|
||||
|
||||
@@ -326,7 +335,15 @@ namespace SepCore.Simulation
|
||||
int pickupCount = _pickups.Count;
|
||||
for (int i = 0; i < pickupCount; i++)
|
||||
{
|
||||
_pickups.State[i] = new PickupStateSim { State = PickupStateSim.StateAbsorbing };
|
||||
PickupStateSim state = _pickups.State[i];
|
||||
if (state.State != PickupStateSim.StateIdle)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
state.State = PickupStateSim.StateAbsorbRequested;
|
||||
state.PhaseElapsed = 0f;
|
||||
_pickups.State[i] = state;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user