コード例 #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);
            int 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
ファイル: EditLine.cs プロジェクト: weimeittx/UnityInGameDbg
        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;
 }