//initialize the evotree with all the evolution forms public void InitEvoTree() { List<EvoForm> working; //temp space for holding results before storage //make sure we actually have a child in our index to establish evotree root if(FindPhaseForm(Phase.child, out working)){ _tree = new EvoTree(new EvoTree.EvoTreeNode(working[0])); //initialize evotree with a single child-phase form List<EvoForm> elderTier = new List<EvoForm>(); //create a final tier list so we can extract all the remaining forms from the dictionary //extract the rest of the forms from the index by phase foreach(EvoForm entry in _evoList){ //if phase is adult, parent to the root node of the evotree if(entry.FormPhase == Phase.adult) _tree.Root.AddChild(new EvoTree.EvoTreeNode(entry)); //if phase is elder, add to temp tier list if(entry.FormPhase == Phase.elder) elderTier.Add(entry); } //categorize the elder tier forms under the appropriate adult forms foreach(EvoForm form in elderTier){ EvoTree.EvoTreeNode parent = _tree.Root.GetChild(form.ParentForm.Name); if(parent != null) parent.AddChild(new EvoTree.EvoTreeNode(parent, form)); } } Debug.Log(_tree.Root.FormKind.Name); foreach(EvoTree.EvoTreeNode child in _tree.Root.Children) Debug.Log(child.FormKind.Name); }
private void Initialize() { if (!isInitialised) { isInitialised = true; Background = GetComponent<Image>(); Icon = GetComponentsInChildren<Image>()[1]; } if (!tree) { tree = GetComponentInParent<EvoTree>(); } }
public void PopulateLock() { Vector3 startPos = new Vector3(0, 0, 0); if(!tree){ tree = FindObjectOfType<EvoTree>(); } if (isVisible) { if (!lockIcon) { GameObject denyIcon = Instantiate(tree.denyIcon, startPos, Quaternion.identity) as GameObject; denyIcon.transform.SetParent(icon.transform, false); lockIcon = denyIcon.gameObject; } } if (lockIcon) { lockIcon.GetComponent<Image>().enabled = true; } }
void Awake() { tree = FindObjectOfType<EvoTree>(); sprite = GetComponent<Image>(); button = GetComponent<Button>(); icon = GetComponentsInChildren<Image>()[1]; hexBack = Resources.Load<Sprite>("HexButton"); PopulateAdaptation(); infoPanel = tree.descriptionPanel; }
void Awake() { exPanel = FindObjectOfType<ExpandedPanel>(); mainPanel = FindObjectOfType<EvoSubTreePanel>(); tree = exPanel.evoTree; nameHeader = GetComponentInChildren<Text>(); Deactivate(); }
public void Awake() { player = FindObjectOfType<Player>(); tree = FindObjectOfType<EvoTree>(); traitDetails = tree.equipedPanel; slots = slotObjects; for (int i = 0; i < slots.Length; i++) { slots[i].GetComponent<Slot>().SetIndex(i); } }