Esempio n. 1
0
        public static void PackSelectScene()
        {
            UnityEngine.Object[] selection = Selection.GetFiltered(typeof(UnityEngine.Object), SelectionMode.DeepAssets);
            if (selection.Length <= 0)
            {
                return;
            }

            List <string> pathList = PackUtils.GetFilesFormObjects(selection, ".unity");

            for (int i = 0; i < pathList.Count; i++)
            {
                string bundleName = PackUtils.GetFileNameFormPath(pathList[i]);
                PackUtils.PackScene(pathList[i], bundleName);
            }
        }
Esempio n. 2
0
        public static void PackSelectAsset()
        {
            UnityEngine.Object[] selection = Selection.GetFiltered(typeof(UnityEngine.Object), SelectionMode.DeepAssets);
            if (selection.Length == 0 || selection.Length > 1000)
            {
                Debug.LogError("selection unusual !!!");
                return;
            }

            List <string> pathList = PackUtils.GetFilesFormObjects(selection, "*.*");

            if (pathList.Count == 1)
            {
                string bundleName = PackUtils.GetFileNameFormPath(pathList[0]);
                PackUtils.PackAsset(pathList.ToArray(), bundleName);
            }
            else if (pathList.Count >= 1)
            {
                string bundleName = PackUtils.GetLastFolderFormPath(pathList[0]);
                PackUtils.PackAsset(pathList.ToArray(), bundleName + "_files");
            }
        }