2020-04-09 10:33:16 +01:00
|
|
|
using MessagePack;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using Unity.Mathematics;
|
|
|
|
|
using static Unity.Mathematics.math;
|
|
|
|
|
|
2020-05-31 03:10:11 +01:00
|
|
|
[MessagePackObject, JsonObject(MemberSerialization.OptIn), RuntimeInspectable]
|
2020-05-06 04:56:36 +01:00
|
|
|
public class VelocityConversionData : BehaviorData
|
2020-04-09 10:33:16 +01:00
|
|
|
{
|
2020-05-31 03:10:11 +01:00
|
|
|
[InspectableField, JsonProperty("traction"), Key(1), RuntimeInspectable]
|
2020-04-09 10:33:16 +01:00
|
|
|
public PerformanceStat Traction = new PerformanceStat();
|
|
|
|
|
|
2020-05-06 04:56:36 +01:00
|
|
|
public override IBehavior CreateInstance(GameContext context, Entity entity, Gear item)
|
2020-04-09 10:33:16 +01:00
|
|
|
{
|
|
|
|
|
return new VelocityConversion(context, this, entity, item);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class VelocityConversion : IBehavior
|
|
|
|
|
{
|
|
|
|
|
public Entity Entity { get; }
|
|
|
|
|
public Gear Item { get; }
|
|
|
|
|
public GameContext Context { get; }
|
|
|
|
|
|
2020-05-06 04:56:36 +01:00
|
|
|
public BehaviorData Data => _data;
|
2020-04-09 10:33:16 +01:00
|
|
|
|
|
|
|
|
private VelocityConversionData _data;
|
|
|
|
|
|
|
|
|
|
public VelocityConversion(GameContext context, VelocityConversionData data, Entity entity, Gear item)
|
|
|
|
|
{
|
|
|
|
|
Context = context;
|
|
|
|
|
_data = data;
|
|
|
|
|
Entity = entity;
|
|
|
|
|
Item = item;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Initialize()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-11 01:17:10 +01:00
|
|
|
public bool Update(float delta)
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Remove()
|
2020-04-09 10:33:16 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|