public void CollectAllSubSKills() { foreach (Transform child in Subskills) { SubskillItem subItem = child.GetComponent <SubskillItem>(); subItem.Init(this); SubskillList.Add(subItem); } }
public void GenLines() { Transform subskills = transform.Find("Expand").Find("Tabs"); List <Transform> ll = new List <Transform>(); foreach (Transform child in subskills) { SubskillItem sub = child.GetComponent <SubskillItem>(); if (sub == null || sub.PreNode == null || sub.ReachedLine == null) { continue; } float angle = Vector3.SignedAngle(transform.up, (sub.transform.position - sub.PreNode.transform.position), Vector3.forward); (sub.ReachedLine.transform as RectTransform).sizeDelta = new Vector2(5, (sub.transform.position - sub.PreNode.transform.position).magnitude); sub.ReachedLine.transform.position = (sub.transform.position + sub.PreNode.transform.position) / 2; sub.ReachedLine.transform.localEulerAngles = new Vector3(0, 0, angle); } }