1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using UnityEngine;
- using UnityEditor;
- using System.Collections.Generic;
- using System.IO;
- using System.Text;
- public class IcelandicCTSBuildShortcutOverride : MonoBehaviour
- {
- [MenuItem ("AV/Build iCTS %&b")]
- static void CustomBuild() {
- AVDebug.Log("Building version "+PlayerSettings.bundleVersion);
- MoveOutForAssetBundlesFolder();
- BuildShortcutOverride.UpdateVersionNumberFromPlayerSettings();
- BuildShortcutOverride.BuildCurrentPlatform();
- MoveBackInForAssetBundlesFolder();
- }
- static void MoveOutForAssetBundlesFolder()
- {
- //It seems NGUI widgets are still referring in serialized members to some textures/materials that
- //actually in asset bundles now, even though they are referring to reference atlases/fonts.
- //Unity thinks they should be included. So let's move them out
- AVDebug.Log("Moving out ForAssetBundles folder");
- string srcPath = Directory.GetCurrentDirectory()+"/Assets/ForAssetBundles";
- string destPath = Directory.GetCurrentDirectory()+"/ForAssetBundles";
- DirectoryInfo forAssetBundlesFolder = new DirectoryInfo(srcPath);
- forAssetBundlesFolder.MoveTo(destPath);
- FileInfo metaFile = new FileInfo(srcPath+".meta");
- metaFile.MoveTo(destPath+".meta");
- }
- static void MoveBackInForAssetBundlesFolder()
- {
- AVDebug.Log("Moving back in ForAssetBundles folder");
- string srcPath = Directory.GetCurrentDirectory()+"/ForAssetBundles";
- string destPath = Directory.GetCurrentDirectory()+"/Assets/ForAssetBundles";
- DirectoryInfo forAssetBundlesFolder = new DirectoryInfo(srcPath);
- forAssetBundlesFolder.MoveTo(destPath);
- FileInfo metaFile = new FileInfo(srcPath+".meta");
- metaFile.MoveTo(destPath+".meta");
- }
- }
|