public void RemoveAutopilot()
        {
            if (m_aiPilot != null)
            {
                m_aiPilot.RemovedFromCockpit();
                m_aiPilot = null;
            }

            if (!Sync.IsServer && (ControllerInfo.Controller == null || !ControllerInfo.IsLocallyControlled()))
                NeedsUpdate &= ~MyEntityUpdateEnum.EACH_10TH_FRAME;
        }
        public void AttachAutopilot(MyAutopilotBase newAutopilot, bool updateSync = true)
        {
            RemoveAutopilot();
            m_aiPilot = newAutopilot;
            m_aiPilot.AttachedToShipController(this);

            if (updateSync && Sync.IsServer)
            {
                MyMultiplayer.RaiseEvent(this, x => x.AttachAutopilot_message, newAutopilot.GetObjectBuilder());
            }

            NeedsUpdate |= MyEntityUpdateEnum.EACH_10TH_FRAME;
        }
        public void AttachAutopilot(MyAutopilotBase newAutopilot, bool updateSync = true)
        {
            RemoveAutopilot();
            m_aiPilot = newAutopilot;
            m_aiPilot.AttachedToShipController(this);

            if (updateSync && Sync.IsServer)
            {
                SyncObject.SendAutopilotAttached(newAutopilot.GetObjectBuilder());
            }

            NeedsUpdate |= MyEntityUpdateEnum.EACH_10TH_FRAME;
        }
 public static MyObjectBuilder_AutopilotBase CreateObjectBuilder(MyAutopilotBase autopilot)
 {
     return m_objectFactory.CreateObjectBuilder<MyObjectBuilder_AutopilotBase>(autopilot);
 }
Exemple #5
0
 public static MyObjectBuilder_AutopilotBase CreateObjectBuilder(MyAutopilotBase autopilot) =>
 m_objectFactory.CreateObjectBuilder <MyObjectBuilder_AutopilotBase>(autopilot);