void Awake() { if (m_TreeElements.Count == 0) { m_TreeElements = MyTreeElementGenerator.GenerateRandomTree(160); } }
// 从m_MyTreeAsset中获取数据 // 如果没有m_MyTreeAsset,将生成随机数据 IList <MyTreeElement> GetData() { if (m_MyTreeAsset != null && m_MyTreeAsset.treeElements != null && m_MyTreeAsset.treeElements.Count > 0) { return(m_MyTreeAsset.treeElements); } // generate some test data return(MyTreeElementGenerator.GenerateRandomTree(130)); }