private static string GetPath(Object obj) { PluginAssert.IsNotNull(obj); string result = AssetDatabase.GetAssetPath(obj); Assert.IsNotNull(result); return(result); }
private void ExecuteWindows(string command) { string path = Path.GetFullPath( Path.Combine(TempLocation, "patchkit-tools.bat")); PluginAssert.IsTrue(File.Exists(path)); string executable = "\"" + path + "\" " + command; Terminal.Start(executable); }
private void ExecuteMac(string command) { string path = Path.GetFullPath(Path.Combine(TempLocation, "patchkit-tools")); PluginAssert.IsTrue(File.Exists(path)); string executable = string.Format("{0} {1}", path, command); Terminal.Start(executable); }
private static PatchKitToolsPackages FindInstance() { string[] guids = AssetDatabase.FindAssets("t:" + typeof(PatchKitToolsPackages).Name); PluginAssert.IsNotNull(guids); PatchKitToolsPackages[] instances = guids .Select(x => AssetDatabase.GUIDToAssetPath(x)) .Select( x => AssetDatabase.LoadAssetAtPath <PatchKitToolsPackages>(x)) .Where(x => x != null) .ToArray(); PluginAssert.AreEqual(1, instances.Length); PluginAssert.IsNotNull(instances[0]); PluginAssert.IsNotNull(instances[0]._windows32); PluginAssert.IsNotNull(instances[0]._windows64); PluginAssert.IsNotNull(instances[0]._linux32); PluginAssert.IsNotNull(instances[0]._mac64); return(instances[0]); }