private void SyncOnFire(bool wasOnFire, bool onFire) { EnsureInit(); //do nothing if this can't burn if (!Resistances.Flammable) { return; } this.onFire = onFire; if (this.onFire) { if (CustomNetworkManager.IsServer) { UpdateManager.Add(PeriodicUpdateBurn, BURN_RATE); } burningObjectOverlay.Burn(); } else { if (CustomNetworkManager.IsServer) { UpdateManager.Remove(CallbackType.PERIODIC_UPDATE, PeriodicUpdateBurn); } burningObjectOverlay.StopBurning(); } }
private void SyncOnFire(bool onFire) { //do nothing if this can't burn if (!Resistances.Flammable) { return; } this.onFire = onFire; if (this.onFire) { burningObjectOverlay.Burn(); } else if (!this.onFire) { burningObjectOverlay.StopBurning(); } }