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)); } }
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); }