Пример #1
0
 private bool IsLineShow(EditGameObject editLine)
 {
     while (editLine.father != null)
     {
         editLine = editLine.father;
         if (!editLine.open)
         {
             return(false);
         }
     }
     return(true);
 }
Пример #2
0
        public EditGameObject CreateEditGameObject(GameObject gameObject, int level, EditGameObject father)
        {
            var editGameObject = new EditGameObject(gameObject, level, father);
            var index          = editGameObjects.IndexOf(editGameObject);

            if (index != -1)
            {
                editGameObjects[index] = editGameObject;
            }
            else
            {
                editGameObjects.Add(editGameObject);
            }
            foreach (Transform child in gameObject.transform)
            {
                editGameObject.children.Add(CreateEditGameObject(child.gameObject, level + 1, editGameObject));
            }
            return(editGameObject);
        }
Пример #3
0
        public void Set(EditGameObject editGameObject)
        {
            nameText.text = editGameObject.gameObject.name;
            Color color;

            if (editGameObject.highlight)
            {
                if (editGameObject.gameObject.activeSelf)
                {
                    color = Color.red;
                }
                else
                {
                    color = new Color(0.7f, 0.1f, 0.1f);
                }
            }
            else
            {
                if (editGameObject.gameObject.activeSelf)
                {
                    color = Color.black;
                }
                else
                {
                    color = new Color(0.3f, 0.3f, 0.3f);
                }
            }
            nameText.color      = color;
            this.editGameObject = editGameObject;
            if (editGameObject.children.Count == 0)
            {
                gameObject.GetComponent <Button>().interactable = false;
                gameObject.GetComponent <Image>().color         = new Color(0, 0, 0, 0);
                label.text = "";
            }
            else
            {
                gameObject.GetComponent <Button>().interactable = true;
                gameObject.GetComponent <Image>().color         = Color.white;
                label.text = editGameObject.open ? "-" : "+";
            }
        }
Пример #4
0
 public EditGameObject(GameObject gameObject, int level, EditGameObject father)
 {
     this.gameObject = gameObject;
     this.level      = level;
     this.father     = father;
 }