public static void BuildiOS(bool debug) { BuildPlayerOptions options = new BuildPlayerOptions(); options.locationPathName = PathRouter.BuildOutput(BuildTarget.iOS.ToString()); options.options = BuildOptions.AcceptExternalModificationsToPlayer | BuildOptions.StrictMode | BuildOptions.SymlinkLibraries; if (debug) { options.options |= BuildOptions.Development | BuildOptions.AllowDebugging; } options.scenes = new string[] { PathRouter.StartScene }; options.target = BuildTarget.iOS; using (new HideCompileFlags()) { string error = BuildPipeline.BuildPlayer(options); if (!string.IsNullOrEmpty(error)) { Debug.LogError(error); } else { Debug.Log("BuildPipeline.BuildPlayer Successfully!"); } } }
public void ClearUnusedFiles() { List <string> filesToRemove = new List <string>(); foreach (string dir in Directory.EnumerateDirectories(PathRouter.SandboxPath)) { foreach (string file in Directory.EnumerateFiles(dir, "*.*", SearchOption.AllDirectories)) { string path = PathRouter.NormalizePath(file); string name = path.Remove(0, PathRouter.SandboxPath.Length); if (!manifest.query.ContainsKey(name)) { filesToRemove.Add(path); } } } foreach (string file in filesToRemove) { File.Delete(file); string name = file.Remove(0, PathRouter.SandboxPath.Length); sandboxFiles.Remove(name); HotfixLog.Log("Remove unused file: " + name); } }
// Use this for initialization void Start() { spawnPoint = GameObject.Find("SpawnPoint"); endPoint = GameObject.Find("EndPoint"); wayPointObj = GameObject.Find("Waypoints"); waypointArray = new Vector3[wayPointObj.transform.childCount + 1]; for (int i = 0; i < waypointArray.Length - 1; i++) { waypointArray[i] = wayPointObj.transform.GetChild(i).position; } waypointArray[waypointArray.Length - 1] = endPoint.transform.position; prevSpawnTime = 1f; autoSpawnColorTag = null; balls = GameObject.Find("/TracingPanel/Balls").transform; once = false; path = GameObject.Find("PathRouter") .GetComponent <PathRouter>(); magicRatio = 0.5f; magicTimeGap = 0.02f; ballDiameter = greenBallPrefab.transform.localScale.x * 2f * magicRatio; spawnInterval = ballDiameter / ballFowardSpeed + magicTimeGap; spawnLock = true; }
public static void Generate(BuildTarget buildTarget) { string path = PathRouter.ProductPath + buildTarget; FileManifest manifest = new FileManifest(); foreach (string file in Directory.EnumerateFiles( path, "*.*", SearchOption.AllDirectories)) { if (Path.GetExtension(file) == ".manifest") { continue; } string name = PathRouter.NormalizePath(file) .Remove(0, path.Length + 1); byte[] bytes = File.ReadAllBytes(file); string md5 = FileManager.GetMd5Hash(bytes); manifest.files.Add(new FileEntry() { name = name, md5 = md5, size = bytes.Length }); } File.WriteAllText( path + '/' + PathRouter.FileManifest, JsonUtility.ToJson(manifest, true), Encoding.UTF8); Debug.Log("Generate File Manifest for " + buildTarget); }
// Use this for initialization void Start () { spawnPoint = GameObject.Find ("SpawnPoint"); endPoint = GameObject.Find ("EndPoint"); wayPointObj = GameObject.Find("Waypoints"); waypointArray = new Vector3[wayPointObj.transform.childCount + 1]; for (int i = 0; i < waypointArray.Length - 1; i++) { waypointArray[i] = wayPointObj.transform.GetChild(i).position; } waypointArray[waypointArray.Length - 1] = endPoint.transform.position; prevSpawnTime = 1f; autoSpawnColorTag = null; balls = GameObject.Find ("/TracingPanel/Balls").transform; once = false; path = GameObject.Find ("PathRouter") .GetComponent<PathRouter>(); magicRatio = 0.5f; magicTimeGap = 0.02f; ballDiameter = greenBallPrefab.transform.localScale.x * 2f * magicRatio; spawnInterval = ballDiameter / ballFowardSpeed + magicTimeGap; spawnLock = true; }
void CollectSandboxFiles() { sandboxFiles = new HashSet <string>(); foreach (string dir in Directory.EnumerateDirectories(PathRouter.SandboxPath)) { foreach (string file in Directory.EnumerateFiles(dir, "*.*", SearchOption.AllDirectories)) { string path = PathRouter.NormalizePath(file); sandboxFiles.Add(path.Remove(0, PathRouter.SandboxPath.Length)); } } }
public override async Task Test() { string folder = Application.dataPath + "/Resources/Prefabs"; foreach (string file in Directory.EnumerateFiles(folder, "*.prefab", SearchOption.AllDirectories)) { string path = PathRouter.NormalizePath(file) .Replace(folder, "Prefabs") .Replace(".prefab", ""); ResLog.Log(path); } await TestAsyncLoad(); await TestLoad(); }
static void CopyFilesToProduct(BuildTarget buildTarget) { string srcRoot = string.Format("{0}/{1}/", Application.dataPath, PathRouter.NoPrefix(PathRouter.Res)); string destRoot = PathRouter.ProductPath + buildTarget + '/'; foreach (string folder in _copyFolders) { CopyDirectory( srcRoot + folder + '/', destRoot + folder + '/', "*.*", v => Path.GetExtension(v) != ".meta"); Debug.LogFormat("{0} folder copied", folder); } }
public static FileManifest ReadFileManifest(string path) { string fullpath; var loc = PathRouter.GetFullPath(path, false, out fullpath); if (loc == PathLocation.NotFound) { throw new FileNotFoundException("ReadFileManifest", path); } string json = FileLoader.LoadString(path); var manifest = JsonUtility.FromJson <FileManifest>(json); manifest.BuildQuery(); return(manifest); }
public override async Task Test() { foreach (string ab in AssetBundleLoader.Manifest.GetAllAssetBundles()) { string relpath = PathRouter.ABFolder + '/' + ab; string fullpath; Assert(PathLocation.NotFound != PathRouter.GetFullPath(relpath, true, out fullpath)); urls.Add(fullpath); } ResLog.Log("ResourceSystem.Init"); await TestLoadOne(urls[0]); ResLog.Log("TestLoadOne finished"); await TestLoadMutiple(); ResLog.Log("TestLoadMutiple finished"); }
public List <string> CalculateUpdateFiles(FileManifest newManifest) { List <string> list = new List <string>(); foreach (var entry in manifest.files) { FileEntry newEntry; if (newManifest.query.TryGetValue(entry.name, out newEntry)) { bool isLocal = (PathLocation.NotFound != PathRouter.Exists(entry.name)); if ((entry.md5 != newEntry.md5 && isLocal) || (!newEntry.remote && !isLocal)) { list.Add(entry.name); } } } return(list); }
// Use this for initialization void Start() { platformAngle = 0; router = GameObject.Find("PathRouter").GetComponent <PathRouter>(); }
// Use this for initialization void Start () { platformAngle = 0; router = GameObject.Find("PathRouter").GetComponent<PathRouter>(); }