Behavior Canceling & Grouping
Behaviors are now grouped, behaviors within a group can cancel execution of the rest of the group
This commit is contained in:
parent
c24c155673
commit
fc94531566
35 changed files with 613 additions and 190 deletions
|
|
@ -6,7 +6,7 @@ using static Unity.Mathematics.math;
|
|||
[MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
||||
public class RadiatorData : BehaviorData
|
||||
{
|
||||
[InspectableField, JsonProperty("emissivity"), Key(0)]
|
||||
[InspectableField, JsonProperty("emissivity"), Key(1)]
|
||||
public PerformanceStat Emissivity = new PerformanceStat();
|
||||
|
||||
public override IBehavior CreateInstance(GameContext context, Entity entity, Gear item)
|
||||
|
|
@ -37,10 +37,15 @@ public class Radiator : IBehavior
|
|||
{
|
||||
}
|
||||
|
||||
public void Update(float delta)
|
||||
public bool Update(float delta)
|
||||
{
|
||||
var rad = pow(Entity.Temperature, Context.GlobalData.HeatRadiationPower) * Context.GlobalData.HeatRadiationMultiplier;
|
||||
Entity.Temperature -= rad * delta;
|
||||
Entity.VisibilitySources[this] = rad;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Remove()
|
||||
{
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue