GetAllTreeShaders() private static method

private static GetAllTreeShaders ( TreeData treeData, List barkShaders, List leafShaders, TreeGroup group ) : void
treeData TreeData
barkShaders List
leafShaders List
group TreeGroup
return void
Beispiel #1
0
 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);
     }
 }
Beispiel #2
0
 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);
 }