コード例 #1
0
        public void ToggleBodies(bool isOn)
        {
            if (BodyTransform == null || panelInterface == null)
            {
                return;
            }

            panelInterface.BodyVisible = isOn;

            BodyTransform.gameObject.SetActive(isOn);

            if (!isOn)
            {
                return;
            }

            for (int i = bodyNodes.Count - 1; i >= 0; i--)
            {
                CW_BodyNode node = bodyNodes[i];

                if (node == null)
                {
                    continue;
                }

                node.gameObject.SetActive(panelInterface.AnyBodyNode(node.BodyName));
            }
        }
コード例 #2
0
        private void CreateBody(string b, List <IStandardNode> n)
        {
            GameObject obj = Instantiate(BodyPrefab);

            if (obj == null)
            {
                return;
            }

            obj.transform.SetParent(BodyTransform, false);

            CW_BodyNode nodeObject = obj.GetComponent <CW_BodyNode>();

            if (nodeObject == null)
            {
                return;
            }

            nodeObject.setBodyType(b, n);

            bodyNodes.Add(nodeObject);
        }
コード例 #3
0
        public void Refresh()
        {
            if (panelInterface == null)
            {
                return;
            }

            if (POIToggle != null)
            {
                POIToggle.gameObject.SetActive(panelInterface.AnyPOI);

                if (POIToggle.isOn)
                {
                    TogglePOIs(true);
                }
            }

            if (StandardToggle != null)
            {
                StandardToggle.gameObject.SetActive(panelInterface.AnyStandard);

                if (StandardToggle.isOn)
                {
                    ToggleStandards(true);
                }
            }

            if (IntervalToggle != null)
            {
                IntervalToggle.gameObject.SetActive(panelInterface.AnyInterval);

                if (IntervalToggle.isOn)
                {
                    for (int i = intervalTypes.Count - 1; i >= 0; i--)
                    {
                        CW_IntervalTypes type = intervalTypes[i];

                        if (type == null)
                        {
                            continue;
                        }

                        if (type.IntervalInterface == null)
                        {
                            continue;
                        }

                        if (!type.IntervalInterface.IsReached)
                        {
                            continue;
                        }

                        type.gameObject.SetActive(true);

                        type.Refresh();
                    }
                }
            }

            if (BodyToggle != null)
            {
                BodyToggle.gameObject.SetActive(panelInterface.AnyBody);

                if (BodyToggle.isOn)
                {
                    for (int i = bodyNodes.Count - 1; i >= 0; i--)
                    {
                        CW_BodyNode body = bodyNodes[i];

                        if (body == null)
                        {
                            continue;
                        }

                        if (!panelInterface.AnyBodyNode(body.BodyName))
                        {
                            continue;
                        }

                        body.gameObject.SetActive(true);

                        body.Refresh();
                    }
                }
            }
        }