Example #1
0
    public void BundleTreeItem_ChangesBundleName_AfterRename()
    {
        string bundle1Name = "bundle1";
        string bundle2Name = "bundle2";

        BundleInfo     b        = new BundleDataInfo(bundle1Name, ABModelUtil.Root);
        BundleTreeItem treeItem = new BundleTreeItem(b, 0, ABModelUtil.FakeTexture2D);

        Model.HandleBundleRename(treeItem, bundle2Name);
        Assert.AreEqual(bundle2Name, treeItem.bundle.m_Name.bundleName);
    }
        internal override BundleTreeItem CreateTreeView(int depth)
        {
            RefreshMessages();
            var result = new BundleTreeItem(this, depth);

            foreach (var child in m_Children)
            {
                result.AddChild(child.Value.CreateTreeView(depth + 1));
            }
            return(result);
        }
Example #3
0
    public void HandleBundleRename_RenamesTo_CorrectAssetBundleName()
    {
        string bundleDataInfoName    = "bundledatainfo";
        string newBundleDataInfoName = "newbundledatainfo";

        BundleDataInfo dataInfo = new BundleDataInfo(bundleDataInfoName, ABModelUtil.Root);
        BundleTreeItem treeItem = new BundleTreeItem(dataInfo, 0, ABModelUtil.FakeTexture2D);

        bool handleBundle = Model.HandleBundleRename(treeItem, newBundleDataInfoName);

        Assert.IsTrue(handleBundle);
        Assert.AreEqual(treeItem.bundle.m_Name.bundleName, newBundleDataInfoName);
    }
Example #4
0
    public void AssetBundleName_GetsRenamed_WhenBundleIsRenamed()
    {
        List <string> listOfPrefabs = new List <string>();

        string bundle1Name = "bundle1";
        string bundle2Name = "bundle2";

        listOfPrefabs.Add(TestUtil.CreatePrefabWithBundleAndVariantName(bundle1Name, String.Empty));

        TestUtil.ExecuteCodeAndCleanupAssets(() =>
        {
            BundleInfo b            = new BundleDataInfo(bundle1Name, ABModelUtil.Root);
            BundleTreeItem treeItem = new BundleTreeItem(b, 0, ABModelUtil.FakeTexture2D);

            Model.HandleBundleRename(treeItem, bundle2Name);

            Assert.AreEqual(bundle2Name, AssetImporter.GetAtPath(listOfPrefabs[0]).assetBundleName);
        }, listOfPrefabs);
    }
        internal override BundleTreeItem CreateTreeView(int depth)
        {
            RefreshMessages();
            if ((m_Children.Count > 0))
            {
                Icon = Model.GetIconByAssetType((m_Children.First().Value as BundleVariantDataInfo).GetVariantAssetType());
            }
            else
            {
                Icon = Model.GetBundleIcon();
            }

            var result = new BundleTreeItem(this, depth);

            foreach (var child in m_Children)
            {
                result.AddChild(child.Value.CreateTreeView(depth + 1));
            }
            return(result);
        }
Example #6
0
    public void BundleFolderInfo_ChildrenTable_UpdatesWhenBundleIsRenamed()
    {
        List <string> listOfPrefabs = new List <string>();

        string bundle1Name = "bundle1";
        string bundle2Name = "bundle2";

        listOfPrefabs.Add(TestUtil.CreatePrefabWithBundleAndVariantName(bundle1Name, String.Empty));

        TestUtil.ExecuteCodeAndCleanupAssets(() =>
        {
            BundleInfo b = new BundleDataInfo(bundle1Name, ABModelUtil.Root);
            ABModelUtil.Root.AddChild(b);
            BundleTreeItem treeItem = new BundleTreeItem(b, 0, ABModelUtil.FakeTexture2D);
            Model.ExecuteAssetMove();

            Assert.AreEqual(bundle1Name, ABModelUtil.Root.GetChildList().ElementAt(0).m_Name.bundleName);
            Model.HandleBundleRename(treeItem, bundle2Name);
            Assert.AreEqual(bundle2Name, ABModelUtil.Root.GetChildList().ElementAt(0).m_Name.bundleName);
        }, listOfPrefabs);
    }