private static GetAllTreeShaders ( |
||
treeData | ||
barkShaders | List |
|
leafShaders | List |
|
group | ||
return | void |
private static void GetAllTreeShaders(TreeData treeData, List <string> barkShaders, List <string> leafShaders, TreeGroup group) { if (group is TreeGroupBranch) { TreeGroupBranch treeGroupBranch = group as TreeGroupBranch; TreeEditorHelper.AddShaderFromMaterial(treeGroupBranch.materialBranch, barkShaders, leafShaders); TreeEditorHelper.AddShaderFromMaterial(treeGroupBranch.materialBreak, barkShaders, leafShaders); TreeEditorHelper.AddShaderFromMaterial(treeGroupBranch.materialFrond, barkShaders, leafShaders); } else { if (group is TreeGroupLeaf) { TreeGroupLeaf treeGroupLeaf = group as TreeGroupLeaf; TreeEditorHelper.AddShaderFromMaterial(treeGroupLeaf.materialLeaf, barkShaders, leafShaders); } } int[] childGroupIDs = group.childGroupIDs; for (int i = 0; i < childGroupIDs.Length; i++) { int id = childGroupIDs[i]; TreeGroup group2 = treeData.GetGroup(id); TreeEditorHelper.GetAllTreeShaders(treeData, barkShaders, leafShaders, group2); } }
public void RefreshAllTreeShaders() { this.m_BarkShaders.Clear(); this.m_LeafShaders.Clear(); TreeEditorHelper.GetAllTreeShaders(this.m_TreeData, this.m_BarkShaders, this.m_LeafShaders, this.m_TreeData.root); }