private void OnComponentUpdated(Flammable.Update update) { if (update.isOnFire.HasValue) { UpdateParticleSystem(update.isOnFire.Value); } }
private void FlammableUpdated(Flammable.Update update) { if (update.isOnFire.HasValue) { anim.SetBool("OnFire", update.isOnFire.Value); } }
private void SendIgniteUpdate() { var update = new Flammable.Update(); update.SetIsOnFire(true).SetCanBeIgnited(false); flammable.Send(update); }
private void OnFlammableUpdated(Flammable.Update update) { if (HasBeenExtinguished(update)) { Owner.TriggerTransition(TreeFSMState.HEALTHY); } }
private void SendExtinguishUpdate(bool canBeIgnited) { var update = new Flammable.Update(); update.SetIsOnFire(false).SetCanBeIgnited(canBeIgnited); flammable.Send(update); }
private void OnFlammableUpdated(Flammable.Update update) { if (HasBeenIgnited(update)) { Owner.TriggerTransition(TreeFSMState.BURNING); } }
private void OnFlammableUpdated(Flammable.Update update) { if (update.isOnFire.HasValue) { UpdateStateMachine(); } }
private void SendExtinguishUpdate(bool canBeIgnited) { var update = new Flammable.Update() { IsOnFire = false, CanBeIgnited = canBeIgnited }; flammable.SendUpdate(update); }
private void SendIgniteUpdate() { var update = new Flammable.Update() { IsOnFire = true, CanBeIgnited = false }; flammable.SendUpdate(update); }
private void FlammableUpdate(Flammable.Update flammableUpdate) { if (WasBurning() && HasBeenExtinguished(flammableUpdate)) { SetState(TreeFSMState.HEALTHY); } else if (HasBeenIgnited(flammableUpdate)) { SetState(TreeFSMState.BURNING); } }
private void SetCanBeIgnited(bool canBeIgnited) { if (flammable.Data.CanBeIgnited != canBeIgnited) { var update = new Flammable.Update() { CanBeIgnited = canBeIgnited }; flammable.SendUpdate(update); } }
public override void Enter() { var update = new Flammable.Update() { CanBeIgnited = false }; flammable.SendUpdate(update); flammable.OnUpdate += (OnFlammableUpdated); health.OnUpdate += (OnHealthUpdated); }
public override void Enter() { var update = new Flammable.Update() { CanBeIgnited = false }; flammable.SendUpdate(update); if (regrowingCoroutine == null) { regrowingCoroutine = parentBehaviour.StartCoroutine(TimerUtils.WaitAndPerform(SimulationSettings.TreeStumpRegrowthTimeSecs, Regrow)); } }
private void FlammableOnComponentUpdated(Flammable.Update update) { if (update.isOnFire.HasValue) { if (flammable.Data.isOnFire) { StartDamageRoutine(); } else { CancelDamageRoutine(); } } }
private void OnFireChange(Flammable.Update fireChange) { if (fireChange.IsOnFire.HasValue) { if (fireChange.IsOnFire.Value) { TriggerIgnitionSound(); StartFireAudio(); } else { StopFireAudio(); TriggerExtinguishSound(); } } }
public override void Enter() { // 进入这个状态的时候,要把树的血设置满 var update = new Health.Update { CurrentHealth = SimulationSettings.TreeMaxHealth }; health.SendUpdate(update); var update2 = new Flammable.Update { CanBeIgnited = true }; flammable.SendUpdate(update2); flammable.OnUpdate += (OnFlammableUpdated); health.OnUpdate += (OnHealthUpdated); }
private bool HasBeenExtinguished(Flammable.Update flammableUpdate) { return(flammableUpdate.isOnFire.HasValue && !flammableUpdate.isOnFire.Value); }
private void FlammableOnComponentUpdated(Flammable.Update update) { canBeIgnited = flammable.Data.canBeIgnited; }
private bool HasBeenIgnited(Flammable.Update flammableUpdate) { return(flammableUpdate.isOnFire.HasValue && flammableUpdate.isOnFire.Value); }