Exemplo n.º 1
0
 void StartPlacing(int unitIndex)
 {
     isPlacing = true;
     currentUnit = unitIndex;
     placeholder = Instantiate(units[currentUnit]);
     placeholder.enabled = true;
     placeholder.GetComponent<TurretNode>().enabled = false;
 }
Exemplo n.º 2
0
 /// <summary>
 /// 获取树的长度
 /// </summary>
 /// <returns></returns>
 public float GetTreeHeight()
 {
     return(m_RootTreeNode != null?m_RootTreeNode.GetItemCount() * NodeTemplate.GetComponent <RectTransform>().sizeDelta.y : 0);
 }
Exemplo n.º 3
0
 private void Awake()
 {
     NodeTemplate = transform.Find("NodeTemplate").gameObject;
     NodeTemplate.GetComponent <RectTransform>().anchoredPosition = new Vector2(10000, 10000);
 }