private bool IsLineShow(EditGameObject editline) { while (editline.father != null) { editline = editline.father; if (!editline.open) { return(false); } } return(true); }
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); }
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 ? "-" : "+"; } }
public EditGameObject(GameObject gameObject, int level, EditGameObject father) { this.gameObject = gameObject; this.level = level; this.father = father; }