コード例 #1
0
        public static BATMController AddOrUpdate(uint persistentId, BurstAtomicThrustModule batm, bool controlAllAttached)
        {
            if (!controlAllAttached || !batmParentParts.ContainsKey(persistentId))
            {
                BATMController b = new BATMController(persistentId, batm);

                b.secondsActivated  = 0;     // batm.secondsActivated;
                b.burstActivated    = false; // batm.burstActivated;
                b.burstTriggered    = false;
                b.savedThrottle     = 0;     // batm.savedThrottle;
                b.savedOrigThrottle = 0;
                batm.primaryBATM    = true;
                b.startTime         = 0f;
                b.endTime           = 0;
                b.primaryBATM       = batm;
                if (controlAllAttached)
                {
                    batmParentParts.Add(persistentId, b);
                }
                else
                {
                    batmParentParts.Add(batm.part.persistentId, b);
                }
                return(b);
            }
            else
            {
                if (!batmParentParts[persistentId].batmList.Contains(batm))
                {
                    batmParentParts[persistentId].batmList.Add(batm);
                }
                return(batmParentParts[persistentId]);
            }
        }
コード例 #2
0
        public void Start()
        {
            if (HighLogic.LoadedSceneIsFlight)
            {
                batmController = BATMController.AddOrUpdate(this.part.vessel.persistentId, this, controlAllAttached);
            }
            else
            {
                batmController = BATMController.AddOrUpdate(0, this, controlAllAttached);
            }

            SetEventTitle();

            // Following is for debugging/identifying primary/secondary part
            if (primaryBATM)
            {
                primary = "BATMController Primary";
            }
            else
            {
                primary = "BATM secondary";
            }


            if (HighLogic.LoadedSceneIsEditor)
            {
                return;
            }
            LoadEngineModules(this.part);
        }