Example #1
0
        public static BundleInfo ConvertToVariant(BundleDataInfo bundle)
        {
            bundle.HandleDelete(true, bundle.m_name.BundleName, kNewVariantBaseName);
            ExecuteAssetMove();
            var root = bundle.Parent.GetChild(bundle.m_name.ShortName) as BundleVariantFolderInfo;

            if (root != null)
            {
                return(root.GetChild(kNewVariantBaseName));
            }
            else
            {
                //we got here because the converted bundle was empty.
                var vfolder = new BundleVariantFolderInfo(bundle.m_name.BundleName, bundle.Parent);
                var vdata   = new BundleVariantDataInfo(bundle.m_name.BundleName + "." + kNewVariantBaseName, vfolder);
                bundle.Parent.AddChild(vfolder);
                vfolder.AddChild(vdata);
                return(vdata);
            }
        }