示例#1
0
        public void UpdateParts()
        {
            // Trigger whenever the number of parts in the vessel changes (like when staging, docking or undocking)
            if (vessel.parts.Count == vesselPartCount)
            {
                return;
            }

            var attachedVolumes = new List <IVolume> {
                cpu.Archive, HardDisk
            };

            // Look for sister units that have newly been added to the vessel
            sisterProcs.Clear();
            foreach (var item in vessel.parts)
            {
                IProcessorModule sisterProc;
                if (item == part || !PartIsKosProc(item, out sisterProc))
                {
                    continue;
                }

                sisterProcs.Add(sisterProc);
                attachedVolumes.Add(sisterProc.HardDisk);
            }

            cpu.UpdateVolumeMounts(attachedVolumes);

            vesselPartCount = vessel.parts.Count;
        }