void CreateTalentTree(PartyUnit unit) { if (debug) { Debug.Log("Talent Tree: " + unit.UnitTalentTree.name); Debug.Log("Talent Count: " + unit.UnitTalentTree.Tree.Count); } GameObject talentTreeAnchor = new GameObject("TalentTreeAnchor"); int row = 0; int collum = 0; //Initilize Icons for (int i = 0; i < unit.UnitTalentTree.Tree.Count; i++) { collum = i % 3 + 1; row = (int)(i / 3) + 1; GameObject talentIcon = Instantiate(GUIIcon, new Vector3(collum, -row * 1.125f, 0), Quaternion.identity) as GameObject; TalentIcon talentIconCached = talentIcon.GetComponent <TalentIcon> (); talentIconCached.Initilize(CurrentlyDisplayedPartyUnit, unit.UnitTalentTree.Tree [i], collum, row); talentIcon.transform.parent = talentTreeAnchor.transform; talentIconCached.pm = this; } //Set Transform talentTreeAnchor.transform.parent = TalentAnchorPoint; talentTreeAnchor.transform.localPosition = Vector3.zero; talentTreeAnchor.transform.localRotation = Quaternion.identity; talentTreeAnchor.transform.localScale = Vector3.one * 0.52f; //Set Array talentIcons = GetComponentsInChildren <TalentIcon> (); TalentWindow.SetActive(false); }
//============================================================================ // Initilization //============================================================================ void Start() { startPosition = transform.position; CCManager = FindObjectOfType <CharacterCustomizerManager> (); if (hType == hoverType.characterSelection) { if (glowObject) { startColor = glowObject.material.GetColor("_TintColor"); } else { startColor = renderer.material.color; } } if (hType == hoverType.talents) { talentIcon = GetComponent <TalentIcon> (); } }