Ejemplo n.º 1
0
        internal override void HandleReparent(string parentName, AssetBundleFolderInfo newParent = null)
        {
            RefreshAssetList();
            string newName = System.String.IsNullOrEmpty(parentName) ? "" : parentName + '/';

            newName += m_Name.shortName;
            if (newName == m_Name.bundleName)
            {
                return;
            }

            if (newParent != null && newParent.GetAssetBundleInfoByName(newName) != null)
            {
                AssetBundleModel.LogWarning("An item named '" + newName + "' already exists at this level in hierarchy.  If your desire is to merge bundles, drag one on top of the other.");
                return;
            }

            foreach (var asset in m_ConcreteAssets)
            {
                AssetBundleModel.MoveAssetToBundle(asset, newName, m_Name.variant);
            }

            if (newParent != null)
            {
                m_Parent.HandleChildRename(m_Name.shortName, string.Empty);
                m_Parent = newParent;
                m_Parent.AddChild(this);
            }
            m_Name.SetBundleName(newName, m_Name.variant);
        }
Ejemplo n.º 2
0
 internal override void HandleDelete(bool isRootOfDelete, string forcedNewName = "", string forcedNewVariant = "")
 {
     RefreshAssetList();
     if (isRootOfDelete)
     {
         m_Parent.HandleChildRename(m_Name.variant, string.Empty);
     }
     AssetBundleModel.MoveAssetToBundle(m_ConcreteAssets, forcedNewName, forcedNewVariant);
 }
Ejemplo n.º 3
0
 internal override bool HandleRename(string newName, int reverseDepth)
 {
     RefreshAssetList();
     if (!base.HandleRename(newName, reverseDepth))
     {
         return(false);
     }
     AssetBundleModel.MoveAssetToBundle(m_ConcreteAssets, m_Name.bundleName, m_Name.variant);
     return(true);
 }
Ejemplo n.º 4
0
 internal override bool HandleRename(string newName, int reverseDepth)
 {
     if (reverseDepth == 0)
     {
         RefreshAssetList();
         if (!m_Parent.HandleChildRename(m_Name.variant, newName))
         {
             return(false);
         }
         m_Name.variant = newName;
         AssetBundleModel.MoveAssetToBundle(m_ConcreteAssets, m_Name.bundleName, m_Name.variant);
     }
     else if (reverseDepth == 1)
     {
         RefreshAssetList();
         m_Name.PartialNameChange(newName + "." + m_Name.variant, 0);
         AssetBundleModel.MoveAssetToBundle(m_ConcreteAssets, m_Name.bundleName, m_Name.variant);
     }
     else
     {
         return(base.HandleRename(newName, reverseDepth - 1));
     }
     return(true);
 }
Ejemplo n.º 5
0
 internal override void HandleDelete(bool isRootOfDelete, string forcedNewName = "", string forcedNewVariant = "")
 {
     RefreshAssetList();
     base.HandleDelete(isRootOfDelete);
     AssetBundleModel.MoveAssetToBundle(m_ConcreteAssets, forcedNewName, forcedNewVariant);
 }