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 ReflectorData : BehaviorData
|
2020-04-09 10:33:16 +01:00
|
|
|
{
|
2020-05-31 03:10:11 +01:00
|
|
|
[InspectableField, JsonProperty("crossSection"), Key(1), RuntimeInspectable]
|
2020-04-09 10:33:16 +01:00
|
|
|
public PerformanceStat CrossSection = new PerformanceStat();
|
|
|
|
|
|
|
|
|
|
// [InspectableAnimationCurve, JsonProperty("visibility"), Key(1)]
|
|
|
|
|
// public float4[] VisibilityCurve;
|
|
|
|
|
|
2020-12-10 23:20:38 +00:00
|
|
|
public override IBehavior CreateInstance(ItemManager context, Entity entity, EquippedItem item)
|
2020-04-09 10:33:16 +01:00
|
|
|
{
|
|
|
|
|
return new Reflector(context, this, entity, item);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class Reflector : IBehavior
|
|
|
|
|
{
|
|
|
|
|
public Entity Entity { get; }
|
2020-12-10 23:20:38 +00:00
|
|
|
public EquippedItem Item { get; }
|
|
|
|
|
public ItemManager Context { get; }
|
2020-04-09 10:33:16 +01:00
|
|
|
|
2020-05-06 04:56:36 +01:00
|
|
|
public BehaviorData Data => _data;
|
2020-04-09 10:33:16 +01:00
|
|
|
|
|
|
|
|
private ReflectorData _data;
|
|
|
|
|
|
2020-12-10 23:20:38 +00:00
|
|
|
public Reflector(ItemManager context, ReflectorData data, Entity entity, EquippedItem item)
|
2020-04-09 10:33:16 +01:00
|
|
|
{
|
|
|
|
|
Context = context;
|
|
|
|
|
_data = data;
|
|
|
|
|
Entity = entity;
|
|
|
|
|
Item = item;
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-11 01:17:10 +01:00
|
|
|
public bool Update(float delta)
|
|
|
|
|
{
|
2020-05-12 01:42:13 +01:00
|
|
|
// TODO: Light system!
|
2020-05-11 01:17:10 +01:00
|
|
|
return true;
|
|
|
|
|
}
|
2020-04-09 10:33:16 +01:00
|
|
|
}
|