Exemple #1
0
        public override void UpdateOnceBeforeFrame()
        {
            base.UpdateOnceBeforeFrame();

            m_resourceSink = Entity.Components.Get <MyResourceSinkComponent> ();
            parseName((IMyTerminalBlock)m_functionalBlock);

            m_info.strength = m_currentMaxPower;

            if (!MyAPIGateway.Multiplayer.IsServer)
            {
                requestSettingsFromServer();
            }

            createUI();

            m_saveInfo = new PTInfo(Entity.EntityId, m_sender, m_channel, m_transmittedPower, "R");
        }
        public override void UpdateAfterSimulation()
        {
            if (m_ticks == 1)
            {
                bool contains = false;
                foreach (var ptInfo in TransmitterLogic.transmittersSaveFile.Transmitters)
                {
                    if (ptInfo.Id == Entity.EntityId)
                    {
                        contains = true;

                        m_saveInfo = ptInfo;
                    }
                }

                if (!contains)
                {
                    m_saveInfo = new PTInfo(Entity.EntityId, m_sender, m_id, m_transmittedPower, "O");
                    TransmitterLogic.transmittersSaveFile.Transmitters.Add(m_saveInfo);
                }
            }
        }