Exemplo n.º 1
0
 public void onNewObjectAdded(GodzGlue.ObjectBase obj)
 {
     //Notify all the listeners a new object was created
     foreach (TabPanelListener p in mListeners)
     {
         p.OnObjectAdded(obj);
     }
 }
Exemplo n.º 2
0
        void TabPanelListener.OnObjectAdded(GodzGlue.ObjectBase obj)
        {
            if (obj is Mesh)
            {
                Mesh m = (Mesh)obj;

                //see if the materials this Mesh has was already added. if not, add it...
                List <Material> mats = new List <Material>();
                m.getMaterials(mats);

                foreach (Material mat in mats)
                {
                    bool foundPackage = false;

                    //do we have the package?
                    foreach (Package p in packages)
                    {
                        if (mat.getPackage().Equals(p))
                        {
                            //found!
                            foundPackage = true;
                            break;
                        }
                    }

                    if (!foundPackage)
                    {
                        //add the package...
                        AddPackage(mat.getPackage());
                    }
                    else
                    {
                        //we already have the package but maybe not this material...
                        Material foundMat = materials.Find(
                            delegate(Material bk)
                        {
                            return(bk == mat);
                        }
                            );

                        if (foundMat == null)
                        {
                            //need to add this material to the tree
                            object treeobj = mMap[mat.getPackage().GetName()];
                            if (treeobj != null)
                            {
                                TreeNode t = (TreeNode)treeobj;
                                AddMaterialToTree(t, mat, 0);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
 void TabPanelListener.OnObjectAdded(GodzGlue.ObjectBase obj)
 {
 }