public override void Init(Sandbox.Common.ObjectBuilders.MyObjectBuilder_CubeBlock objectBuilder, Sandbox.Game.Entities.MyCubeGrid cubeGrid) { base.Init(objectBuilder, cubeGrid); m_solarPanelDefinition = BlockDefinition as MySolarPanelDefinition; IsWorkingChanged += OnIsWorkingChanged; NeedsUpdate = MyEntityUpdateEnum.EACH_100TH_FRAME; GameLogic = new MySolarGameLogicComponent(); m_solarComponent = GameLogic as MySolarGameLogicComponent; m_solarComponent.Initialize(m_solarPanelDefinition.PanelOrientation, m_solarPanelDefinition.IsTwoSided, m_solarPanelDefinition.PanelOffset, this); AddDebugRenderComponent(new Components.MyDebugRenderComponentSolarPanel(this)); }
public override void Init(Sandbox.Common.ObjectBuilders.MyObjectBuilder_CubeBlock objectBuilder, Sandbox.Game.Entities.MyCubeGrid cubeGrid) { base.Init(objectBuilder, cubeGrid); m_oxygenFarmDefinition = BlockDefinition as MyOxygenFarmDefinition; IsWorkingChanged += OnIsWorkingChanged; NeedsUpdate = MyEntityUpdateEnum.EACH_10TH_FRAME | MyEntityUpdateEnum.EACH_100TH_FRAME; InitializeConveyorEndpoint(); PowerReceiver = new MyPowerReceiver( MyConsumerGroupEnum.Factory, false, m_oxygenFarmDefinition.OperationalPowerConsumption, ComputeRequiredPower); PowerReceiver.IsPoweredChanged += PowerReceiver_IsPoweredChanged; PowerReceiver.Update(); GameLogic = new MySolarGameLogicComponent(); m_solarComponent = GameLogic as MySolarGameLogicComponent; m_solarComponent.Initialize(m_oxygenFarmDefinition.PanelOrientation, m_oxygenFarmDefinition.IsTwoSided, m_oxygenFarmDefinition.PanelOffset, this); AddDebugRenderComponent(new Components.MyDebugRenderComponentSolarPanel(this)); }