Ejemplo n.º 1
0
        private UTinyAssetTreeViewItem BuildItem(UTinyAssetInfo assetInfo, int depth)
        {
            var item = new UTinyAssetTreeViewItem(Model.Registry, Model.MainModule, Model.MainModule, assetInfo)
            {
                id       = Model.GenerateId(assetInfo),
                Editable = assetInfo.ExplicitReferences.Contains(Model.MainModule),
                depth    = depth
            };

            if (assetInfo.Parent != null)
            {
                item.icon = EditorGUIUtility.ObjectContent(null, assetInfo.Object.GetType()).image as Texture2D;
            }

            foreach (var child in assetInfo.Children)
            {
                item.AddChild(BuildItem(child, depth + 1));
            }

            return(item);
        }