Example #1
0
 public void InspectorInit()
 {
     SetPanelActive(true);
     elementAttbutes = elementObject.GetObjAttbutes();
     attName.SetActive(elementAttbutes.IsShowName);
     attScale.SetActive(elementAttbutes.IsShowSca);
     attRot.SetActive(elementAttbutes.IsShowRot);
     attPos.SetActive(elementAttbutes.IsShowPos);
     attTrafficLight.SetActive(elementAttbutes.IsShowTraffic);
     attHuman.SetActive(elementAttbutes.IsShowHuman);
     attCarAI.SetActive(elementAttbutes.IsShowCarAI);
     attDelete.SetActive(elementAttbutes.IsShowDelete);
     if (elementAttbutes.IsShowName)
     {
         UpdateName();
     }
     if (elementAttbutes.IsShowHuman)
     {
         UpdateHumanData();
     }
     if (elementAttbutes.IsShowCarAI)
     {
         UpdateCarAIData();
     }
     if (elementAttbutes.IsShowTraffic)
     {
         UpdateTrafficLightData();
     }
 }
Example #2
0
 public void InspectorUpdate()
 {
     elementAttbutes = elementObject.GetObjAttbutes();
     if (elementAttbutes.IsShowPos || elementAttbutes.IsShowRot || elementAttbutes.IsShowSca)
     {
         UpdateTransformDate();
     }
 }
        public void InspectorInit()
        {
            SetPanelActive(true);
            currentElementObj = ElementsManager.Instance.SelectedElement;
            if (currentElementObj == null)
            {
                return;
            }
            transform.gameObject.SetActive(true);
            attbutes = currentElementObj.GetObjAttbutes();
            for (int i = 1; i < attGameObjects.Length; i++)
            {
                attGameObjects[i].SetActive(false);
            }
            foreach (ElementObject.ElementAttribute item in attbutes.attributes)
            {
                int index = (int)item;
                attGameObjects[index + 1].SetActive(true);
                SetNameAtt();
                switch (item)
                {
                case ElementObject.ElementAttribute.Position:
                    SetPosAtt();
                    break;

                case ElementObject.ElementAttribute.Rotation:
                    SetRotAtt();
                    break;

                case ElementObject.ElementAttribute.Scale:
                    SetScaleAtt();
                    break;

                case ElementObject.ElementAttribute.Human:
                    SetHumanAtt();
                    break;

                case ElementObject.ElementAttribute.TrafficLight:
                    SetTrafficAtt();
                    break;

                case ElementObject.ElementAttribute.CarAI:
                    break;

                default:
                    break;
                }
            }
        }
        void Update()
        {
            currentElementObj = ElementsManager.Instance.SelectedElement;
            if (currentElementObj != null)
            {
                attbutes = currentElementObj.GetObjAttbutes();
                foreach (ElementObject.ElementAttribute item in attbutes.attributes)
                {
                    int index = (int)item;
                    attGameObjects[index + 1].SetActive(true);
                    switch (item)
                    {
                    case ElementObject.ElementAttribute.Position:
                        if (ObjPos != attbutes.pos)
                        {
                            SetPosAtt();
                        }
                        break;

                    case ElementObject.ElementAttribute.Rotation:
                        if (ObjRot != attbutes.rot)
                        {
                            SetRotAtt();
                        }
                        break;

                    case ElementObject.ElementAttribute.Scale:
                        if (ObjScale != attbutes.sca)
                        {
                            SetScaleAtt();
                        }
                        break;

                    case ElementObject.ElementAttribute.Human:
                        if (!attbutes.humanAtt.aimList.TrueForAll(HumanAimPoses.Contains))
                        {
                            SetHumanAtt();
                        }
                        break;

                    case ElementObject.ElementAttribute.TrafficLight:
                        if (mode != attbutes.trafficLigghtAtt.mode)
                        {
                            mode = attbutes.trafficLigghtAtt.mode;
                            SetTrafficAtt();
                        }
                        break;

                    case ElementObject.ElementAttribute.CarAI:
                        if (ObjSpdCarAI != attbutes.spdCarAI)
                        {
                            ObjSpdCarAI = attbutes.spdCarAI;
                            SetCarAIAtt();
                        }
                        break;

                    default:
                        break;
                    }
                }
            }
        }