public override void Close() { m_block.StartedProducing -= OnStateChanged; m_block.StoppedProducing -= OnStateChanged; m_block.IsWorkingChanged -= OnIsWorkingChanged; m_block = null; base.Close(); }
public override void Init(MyObjectBuilder_EntityBase objectBuilder) { m_generator = Entity as Sandbox.ModAPI.IMyAssembler; builder = objectBuilder; Entity.NeedsUpdate |= MyEntityUpdateEnum.EACH_FRAME | MyEntityUpdateEnum.EACH_10TH_FRAME; terminalBlock = Entity as Sandbox.ModAPI.IMyTerminalBlock; }
public override void Init(MyObjectBuilder_EntityBase objectBuilder) { NeedsUpdate |= MyEntityUpdateEnum.BEFORE_NEXT_FRAME; m_block = (Sandbox.ModAPI.IMyAssembler)Entity; m_block.StartedProducing += OnStateChanged; m_block.StoppedProducing += OnStateChanged; m_block.IsWorkingChanged += OnIsWorkingChanged; base.Init(objectBuilder); }
public override void Init(MyObjectBuilder_EntityBase objectBuilder) { m_generator = Entity as Sandbox.ModAPI.IMyAssembler; m_parent = Entity as IMyCubeBlock; builder = objectBuilder; Entity.NeedsUpdate |= MyEntityUpdateEnum.EACH_FRAME | MyEntityUpdateEnum.EACH_100TH_FRAME; terminalBlock = Entity as Sandbox.ModAPI.IMyTerminalBlock; if (!m_bInit) { m_bInit = true; LoadTerminalValues(); CreateTerminalControls(); } }
public override void Close() { m_block = null; }
public override void Init(MyObjectBuilder_EntityBase objectBuilder) { NeedsUpdate |= MyEntityUpdateEnum.EACH_10TH_FRAME; m_block = (Sandbox.ModAPI.IMyAssembler)Entity; }
private void Assembler_OnModeChanged(Sandbox.ModAPI.IMyAssembler assembler) { assembler.CurrentModeChanged -= Assembler_OnModeChanged; assembler.Mode = MyAssemblerMode.Assembly; assembler.CurrentModeChanged += Assembler_OnModeChanged; }