public void SetFlameState(FlameState state) { if (state == flameState) { return; } switch (state) { case FlameState.NONE: ResetFire(); break; case FlameState.HEATING: SetHeating(); break; case FlameState.BURNED_OUT: SetBurnedOut(); break; case FlameState.BURNING: SetBurning(); fireSim.AddFire(this); break; case FlameState.COOLING: SetCooling(); break; default: break; } if (flameState == FlameState.BURNING && state != FlameState.BURNING) { fireSim.RemoveFire(this); } flameState = state; }
public void Delete() { fireSim.RemoveFire(this); Destroy(gameObject); }