public void Update() { if (part.State == PartStates.DEAD) { cpu.Mode = CPU.Modes.OFF; return; } cpu.Update(Time.deltaTime); cpu.ProcessElectricity(this.part, TimeWarp.fixedDeltaTime); UpdateParts(); }
public void Update() { if (cpu == null) { return; } Events["TogglePowerOn"].active = Events["TogglePowerOn"].guiActiveUnfocused = cpu.Mode == CPU.Modes.OFF; Events["TogglePowerOff"].active = Events["TogglePowerOff"].guiActiveUnfocused = cpu.Mode != CPU.Modes.OFF; if (part.State == PartStates.DEAD) { cpu.Mode = CPU.Modes.OFF; return; } cpu.Update(Time.deltaTime); cpu.ProcessElectricity(this.part, TimeWarp.fixedDeltaTime); UpdateParts(); }