// Gamelogic initialization public override void Init(MyObjectBuilder_EntityBase objectBuilder) { // Update each frame, note this may not work for all object's types! Entity.NeedsUpdate |= MyEntityUpdateEnum.EACH_FRAME; block = Entity as BlockModAPIType; if (block == null || MyAPIGateway.Session == null) return; BlockInit(); active = true; }
// Gamelogic initialization public override void Init(MyObjectBuilder_EntityBase objectBuilder) { // Update each frame, note this may not work for all object's types! Entity.NeedsUpdate |= MyEntityUpdateEnum.EACH_FRAME; block = Entity as BlockModAPIType; if (block == null || MyAPIGateway.Session == null) { return; } BlockInit(); active = true; }
// Gamelogic close when the block gets deleted public override void Close() { block = null; }