private void CreateVesselSections(IList <IVesselSection> sections)
        {
            if (sections == null)
            {
                return;
            }

            if (sections.Count <= 0)
            {
                return;
            }

            if (VesselSectionPrefab == null)
            {
                return;
            }

            if (VesselSectionTransform == null)
            {
                return;
            }

            for (int i = sections.Count - 1; i >= 0; i--)
            {
                IVesselSection section = sections[i];

                if (section == null)
                {
                    continue;
                }

                CreateVesselSection(section);
            }
        }
Beispiel #2
0
        private void CreateVesselSection(IVesselSection section)
        {
            if (VesselPrefab == null || VesselTransform == null)
            {
                return;
            }

            GameObject sectionObject = Instantiate(VesselPrefab);

            if (sectionObject == null)
            {
                return;
            }

            sectionObject.transform.SetParent(VesselTransform, false);

            SEP_VesselSection vSection = sectionObject.GetComponent <SEP_VesselSection>();

            if (vSection == null)
            {
                return;
            }

            vSection.setVessel(section);

            currentVessel = vSection;
        }
        public void removeVesselSection(IVesselSection section)
        {
            if (section == null)
            {
                return;
            }

            for (int i = currentVessels.Count - 1; i >= 0; i--)
            {
                SEP_VesselSection v = currentVessels[i];

                if (v == null)
                {
                    continue;
                }

                if (v.ID != section.ID)
                {
                    continue;
                }

                currentVessels.RemoveAt(i);
                Destroy(v.gameObject);
                break;
            }
        }
        private void CreateVesselSections(IList <IVesselSection> sections)
        {
            if (sections == null)
            {
                return;
            }

            if (sections.Count <= 0)
            {
                return;
            }

            currentVessels.Clear();

            for (int i = sections.Count - 1; i >= 0; i--)
            {
                IVesselSection section = sections[i];

                if (section == null)
                {
                    continue;
                }

                CreateVesselSection(section);
            }
        }
        public void setVessel(IVesselSection vessel, SEP_Window win)
        {
            if (vessel == null)
            {
                return;
            }

            window = win;

            vesselInterface = vessel;

            if (VesselTitle != null)
            {
                VesselTitle.text = vessel.Name;
            }

            if (SituationText != null)
            {
                SituationText.text = vessel.Situation;
            }

            if (TransmissionBackground != null)
            {
                if (vesselInterface.CanTransmit && vesselInterface.AutoTransmitAvailable)
                {
                    TransmissionBackground.color = green;
                }
                else
                {
                    TransmissionBackground.color = grey;
                }
            }

            vesselInterface.IsVisible = true;

            CreateExperimentSections(vesselInterface.GetExperiments());

            if (StartAll != null && PauseAll != null)
            {
                if (anyRunning())
                {
                    PauseAll.gameObject.SetActive(true);
                }
                else
                {
                    PauseAll.gameObject.SetActive(false);
                }

                if (anyPaused())
                {
                    StartAll.gameObject.SetActive(true);
                }
                else
                {
                    StartAll.gameObject.SetActive(false);
                }
            }

            vesselInterface.setParent(this);
        }
        public void addVesselSection(IVesselSection section)
        {
            if (section == null)
            {
                return;
            }

            CreateVesselSection(section);
        }
Beispiel #7
0
        public void SetNewVessel(IVesselSection vessel)
        {
            if (vessel == null)
            {
                return;
            }

            if (currentVessel != null)
            {
                currentVessel.gameObject.SetActive(false);

                Destroy(currentVessel.gameObject);
            }

            id = vessel.ID;

            CreateVesselSection(vessel);
        }
        private void CreateVesselSection(IVesselSection section)
        {
            GameObject sectionObject = Instantiate(VesselSectionPrefab);

            if (sectionObject == null)
            {
                return;
            }

            windowInterface.ProcessStyle(sectionObject);

            sectionObject.transform.SetParent(VesselSectionTransform, false);

            SEP_VesselSection vSection = sectionObject.GetComponent <SEP_VesselSection>();

            if (vSection == null)
            {
                return;
            }

            vSection.setVessel(section, this);
        }
        public void setVessel(IVesselSection vessel)
        {
            if (vessel == null)
            {
                return;
            }

            vesselInterface = vessel;

            id = vessel.ID;

            if (VesselTitle != null)
            {
                VesselTitle.OnTextUpdate.Invoke(vessel.Name);
            }

            if (SituationText != null)
            {
                SituationText.OnTextUpdate.Invoke(vessel.Situation);
            }

            if (TransmissionBackground != null)
            {
                if (vesselInterface.CanTransmit && vesselInterface.AutoTransmitAvailable)
                {
                    TransmissionBackground.color = green;
                }
                else
                {
                    TransmissionBackground.color = grey;
                }
            }

            if (SEP_Window.Window != null && SEP_Window.Window.ScrollRect != null && TitleHighlighter != null)
            {
                TitleHighlighter.setScroller(SEP_Window.Window.ScrollRect);
            }

            vesselInterface.IsVisible = true;

            CreateExperimentSections(vesselInterface.GetExperiments());

            if (StartAll != null && PauseAll != null)
            {
                if (anyRunning())
                {
                    PauseAll.gameObject.SetActive(true);
                }
                else
                {
                    PauseAll.gameObject.SetActive(false);
                }

                if (anyPaused())
                {
                    StartAll.gameObject.SetActive(true);
                }
                else
                {
                    StartAll.gameObject.SetActive(false);
                }
            }

            setExpCount(vesselInterface.ExpCount);
            setBiome(vesselInterface.Situation);

            vesselInterface.setParent(this);
        }