SetAssets() private méthode

private SetAssets ( string assets ) : void
assets string
Résultat void
Exemple #1
0
        public static void ShowWindow(string[] inAssets, out string[] assetsThatShouldBeSaved)
        {
            int numMetaFiles = 0;

            foreach (string path in inAssets)
            {
                if (path.EndsWith("meta"))
                {
                    numMetaFiles++;
                }
            }
            int numAssets = inAssets.Length - numMetaFiles;

            if (numAssets == 0)
            {
                assetsThatShouldBeSaved = inAssets;
                return;
            }

            string[] assets    = new string[numAssets];
            string[] metaFiles = new string[numMetaFiles];

            numAssets    = 0;
            numMetaFiles = 0;

            foreach (string path in inAssets)
            {
                if (path.EndsWith("meta"))
                {
                    metaFiles[numMetaFiles++] = path;
                }
                else
                {
                    assets[numAssets++] = path;
                }
            }

            AssetSaveDialog win = EditorWindow.GetWindowDontShow <AssetSaveDialog>();

            win.titleContent = EditorGUIUtility.TrTextContent("Save Assets");
            win.SetAssets(assets);

            win.minSize = new Vector2(400, 100);
            win.maxSize = new Vector2(550, 550);

            win.ShowModalUtility();
            win.ShowModal();

            assetsThatShouldBeSaved = new string[win.m_AssetsToSave.Count + numMetaFiles];
            win.m_AssetsToSave.CopyTo(assetsThatShouldBeSaved, 0);
            metaFiles.CopyTo(assetsThatShouldBeSaved, win.m_AssetsToSave.Count);
        }
Exemple #2
0
        public static void ShowWindow(string[] inAssets, out string[] assetsThatShouldBeSaved)
        {
            int num = 0;

            for (int i = 0; i < inAssets.Length; i++)
            {
                string text = inAssets[i];
                if (text.EndsWith("meta"))
                {
                    num++;
                }
            }
            int num2 = inAssets.Length - num;

            if (num2 == 0)
            {
                assetsThatShouldBeSaved = inAssets;
            }
            else
            {
                string[] array  = new string[num2];
                string[] array2 = new string[num];
                num2 = 0;
                num  = 0;
                for (int j = 0; j < inAssets.Length; j++)
                {
                    string text2 = inAssets[j];
                    if (text2.EndsWith("meta"))
                    {
                        array2[num++] = text2;
                    }
                    else
                    {
                        array[num2++] = text2;
                    }
                }
                AssetSaveDialog windowDontShow = EditorWindow.GetWindowDontShow <AssetSaveDialog>();
                windowDontShow.titleContent = EditorGUIUtility.TextContent("Save Assets");
                windowDontShow.SetAssets(array);
                windowDontShow.ShowUtility();
                windowDontShow.ShowModal();
                assetsThatShouldBeSaved = new string[windowDontShow.m_AssetsToSave.Count + num];
                windowDontShow.m_AssetsToSave.CopyTo(assetsThatShouldBeSaved, 0);
                array2.CopyTo(assetsThatShouldBeSaved, windowDontShow.m_AssetsToSave.Count);
            }
        }
Exemple #3
0
        public static void ShowWindow(string[] inAssets, out string[] assetsThatShouldBeSaved)
        {
            int num = 0;

            foreach (string str in inAssets)
            {
                if (str.EndsWith("meta"))
                {
                    num++;
                }
            }
            int num3 = inAssets.Length - num;

            if (num3 == 0)
            {
                assetsThatShouldBeSaved = inAssets;
            }
            else
            {
                string[] assets    = new string[num3];
                string[] strArray3 = new string[num];
                num3 = 0;
                num  = 0;
                foreach (string str2 in inAssets)
                {
                    if (str2.EndsWith("meta"))
                    {
                        strArray3[num++] = str2;
                    }
                    else
                    {
                        assets[num3++] = str2;
                    }
                }
                AssetSaveDialog windowDontShow = EditorWindow.GetWindowDontShow <AssetSaveDialog>();
                windowDontShow.titleContent = EditorGUIUtility.TextContent("Save Assets");
                windowDontShow.SetAssets(assets);
                windowDontShow.ShowUtility();
                windowDontShow.ShowModal();
                assetsThatShouldBeSaved = new string[windowDontShow.m_AssetsToSave.Count + num];
                windowDontShow.m_AssetsToSave.CopyTo(assetsThatShouldBeSaved, 0);
                strArray3.CopyTo(assetsThatShouldBeSaved, windowDontShow.m_AssetsToSave.Count);
            }
        }
        public static void ShowWindow(string[] inAssets, out string[] assetsThatShouldBeSaved)
        {
            int length1 = 0;

            foreach (string inAsset in inAssets)
            {
                if (inAsset.EndsWith("meta"))
                {
                    ++length1;
                }
            }
            int length2 = inAssets.Length - length1;

            if (length2 == 0)
            {
                assetsThatShouldBeSaved = inAssets;
            }
            else
            {
                string[] assets   = new string[length2];
                string[] strArray = new string[length1];
                int      num1     = 0;
                int      num2     = 0;
                foreach (string inAsset in inAssets)
                {
                    if (inAsset.EndsWith("meta"))
                    {
                        strArray[num2++] = inAsset;
                    }
                    else
                    {
                        assets[num1++] = inAsset;
                    }
                }
                AssetSaveDialog windowDontShow = EditorWindow.GetWindowDontShow <AssetSaveDialog>();
                windowDontShow.titleContent = EditorGUIUtility.TextContent("Save Assets");
                windowDontShow.SetAssets(assets);
                windowDontShow.ShowUtility();
                windowDontShow.ShowModal();
                assetsThatShouldBeSaved = new string[windowDontShow.m_AssetsToSave.Count + num2];
                windowDontShow.m_AssetsToSave.CopyTo(assetsThatShouldBeSaved, 0);
                strArray.CopyTo((Array)assetsThatShouldBeSaved, windowDontShow.m_AssetsToSave.Count);
            }
        }