本文整理汇总了C#中BuildTarget类的典型用法代码示例。如果您正苦于以下问题:C# BuildTarget类的具体用法?C# BuildTarget怎么用?C# BuildTarget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BuildTarget类属于命名空间,在下文中一共展示了BuildTarget类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnPostprocessBuild
public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
{
#if UNITY_IPHONE
string projectPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
PBXProject project = new PBXProject();
project.ReadFromString(File.ReadAllText(projectPath));
// This is the project name that Unity generates for iOS, isn't editable until after post processing
string target = project.TargetGuidByName(PBXProject.GetUnityTargetName());
#if UNITY_5_0
project.AddBuildProperty(target, "FRAMEWORK_SEARCH_PATHS", "$(PROJECT_DIR)/Frameworks/Plugins/iOS");
#else
CopyAndReplaceDirectory("Assets/Plugins/iOS/FiksuSDK.bundle", Path.Combine(path, "Frameworks/FiksuSDK.bundle"));
project.AddFileToBuild(target, project.AddFile("Frameworks/FiksuSDK.bundle", "Frameworks/FiksuSDK.bundle", PBXSourceTree.Source));
CopyAndReplaceDirectory("Assets/Plugins/iOS/FiksuSDK.framework", Path.Combine(path, "Frameworks/FiksuSDK.framework"));
project.AddFileToBuild(target, project.AddFile("Frameworks/FiksuSDK.framework", "Frameworks/FiksuSDK.framework", PBXSourceTree.Source));
project.SetBuildProperty(target, "FRAMEWORK_SEARCH_PATHS", "$(inherited)");
project.AddBuildProperty(target, "FRAMEWORK_SEARCH_PATHS", "$(PROJECT_DIR)/Frameworks");
#endif
project.AddFrameworkToProject(target, "AdSupport.framework", true);
project.AddFrameworkToProject(target, "StoreKit.framework", true);
project.AddFrameworkToProject(target, "Security.framework", true);
project.AddFrameworkToProject(target, "SystemConfiguration.framework", false);
project.AddFrameworkToProject(target, "MessageUI.framework", false);
File.WriteAllText(projectPath, project.WriteToString());
#endif
}
开发者ID:zrrz,项目名称:GrooveGame,代码行数:34,代码来源:FiksuPostBuild.cs
示例2: OnPostprocessBuild
public static void OnPostprocessBuild(BuildTarget buildTarget, string path) {
if (buildTarget == BuildTarget.Android) {
SendBuildEvent ();
}
}
开发者ID:AnotherGameCompany,项目名称:FC-BlazeIt,代码行数:7,代码来源:FabricBuildEventAndroid.cs
示例3: OnPostProcessBuild
public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject)
{
// Figure out which architecture we're building for.
int arch;
if (target == BuildTarget.StandaloneWindows)
arch = 32;
else if (target == BuildTarget.StandaloneWindows64)
arch = 64;
else
return;
// Rename the target to a .bin file for the auto-patcher to find later.
string autoPatcherPath = Application.dataPath + "/OVR/Editor/OculusUnityPatcher_" + arch.ToString() + ".exe";
string targetPath = pathToBuiltProject.Replace(".exe", "_DirectToRift.exe");
if (File.Exists(targetPath))
File.Delete(targetPath);
File.Copy(autoPatcherPath, targetPath);
string appInfoPath = pathToBuiltProject.Replace(".exe", "_Data/OVRAppInfo");
var file = new System.IO.StreamWriter(appInfoPath);
file.Write(PlayerSettings.companyName + "\\" + PlayerSettings.productName);
file.Dispose();
}
开发者ID:SergioMadrigal,项目名称:Oculus,代码行数:25,代码来源:OVRShimLoader.cs
示例4: BuildAndRun
private static void BuildAndRun (BuildTarget target, List<string> sceneList)
{
var resultFilePath = GetParameterArgument (resultFileDirParam);
int port = 0;
List<string> ipList = TestRunnerConfigurator.GetAvailableNetworkIPs ();
var config = new PlatformRunnerConfiguration ()
{
buildTarget = target,
scenes = sceneList.ToArray (),
projectName = "IntegrationTests",
resultsDir = resultFilePath,
sendResultsOverNetwork = InternalEditorUtility.inBatchMode,
ipList = ipList,
port = port
};
if (Application.isWebPlayer)
{
config.sendResultsOverNetwork = false;
Debug.Log ("You can't use WebPlayer as active platform for running integraiton tests. Switching to Standalone");
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneWindows);
}
PlatformRunner.BuildAndRunInPlayer (config);
}
开发者ID:illusyon,项目名称:unity3d-plugin,代码行数:27,代码来源:Batch.cs
示例5: BuildGame
public static void BuildGame(BuildTarget buildTarget, BuildOptions buildOptions = BuildOptions.None)
{
if (BuildPipeline.isBuildingPlayer == false) {
UnityEngine.Debug.ClearDeveloperConsole();
var smcsFile = Path.Combine( Application.dataPath, "smcs.rsp" );
var gmcsFile = Path.Combine( Application.dataPath, "gmcs.rsp" );
// -define:debug;poop
File.WriteAllText( smcsFile, "-define:BUILD" );
File.WriteAllText( gmcsFile, "-define:BUILD" );
AssetDatabase.Refresh();
string[] scenes = GetSceneList();
//string path = Application.dataPath.Remove(Application.dataPath.Length - 8, 7) + "_build";
// Build player.
BuildPipeline.BuildPlayer(scenes, path + "/" + StringManager.BUILDNAME + ".exe", buildTarget, buildOptions);
// Copy a file from the project folder to the build folder, alongside the built game. eg:
// FileUtil.CopyFileOrDirectory("Assets/WebPlayerTemplates/Readme.txt", path + "Readme.txt");
//remove build thingies
File.WriteAllText( smcsFile, "" );
File.WriteAllText( gmcsFile, "" );
}
}
开发者ID:chicostategamestudios,项目名称:qk-pop,代码行数:28,代码来源:ScriptBuild.cs
示例6: OnPostprocessBuild
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) {
#if !DISABLEREDISTCOPY
string strProjectName = Path.GetFileNameWithoutExtension(pathToBuiltProject);
if (target == BuildTarget.StandaloneWindows64) {
CopyFile("steam_api64.dll", "steam_api64.dll", pathToBuiltProject);
}
else if (target == BuildTarget.StandaloneWindows) {
CopyFile("steam_api.dll", "steam_api.dll", pathToBuiltProject);
}
string controllerCfg = Path.Combine(Application.dataPath, "controller.vdf");
if (File.Exists(controllerCfg)) {
string dir = "_Data";
if (target == BuildTarget.StandaloneOSXIntel || target == BuildTarget.StandaloneOSXIntel64 || target == BuildTarget.StandaloneOSXUniversal) {
dir = ".app/Contents";
}
string strFileDest = Path.Combine(Path.Combine(Path.GetDirectoryName(pathToBuiltProject), strProjectName + dir), "controller.vdf");
File.Copy(controllerCfg, strFileDest);
if (!File.Exists(strFileDest)) {
Debug.LogWarning("[Steamworks.NET] Could not copy controller.vdf into the built project. File.Copy() Failed. Place controller.vdf from the Steamworks SDK in the output dir manually.");
}
}
#endif
}
开发者ID:joeju,项目名称:Steamworks.NET,代码行数:28,代码来源:RedistCopy.cs
示例7: OnPostprocessBuild
public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
{
#if !UNITY_CLOUD_BUILD
Debug.Log ("[UNITY_CLOUD_BUILD] OnPostprocessBuild");
ProcessPostBuild (buildTarget, path);
#endif
}
开发者ID:unitychrism,项目名称:googleadsunity,代码行数:7,代码来源:PostBuildProcessor.cs
示例8: OnPostprocessBuild
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
{
if (target != BuildTarget.iPhone) {
return;
}
#if NO_GPGS
// remove plugin code from generated project
string pluginDir = pathToBuiltProject + "/Libraries/Plugins/iOS";
GPGSUtil.WriteFile(pluginDir + "/GPGSAppController.mm", "// Empty since NO_GPGS is defined\n");
return;
#endif
if (GetBundleId() == null) {
UnityEngine.Debug.LogError("The iOS bundle ID has not been set up through the " +
"'iOS Setup' submenu of 'Google Play Games' - the generated xcode project will " +
"not work properly.");
return;
}
UnityEngine.Debug.Log("Adding URL Types for authentication using PlistBuddy.");
UpdateGeneratedInfoPlistFile(pathToBuiltProject + "/Info.plist");
UpdateGeneratedPbxproj(pathToBuiltProject + "/Unity-iPhone.xcodeproj/project.pbxproj");
EditorWindow.GetWindow<GPGSInstructionWindow>(
utility: true,
title: "Building for IOS",
focus: true);
}
开发者ID:noelyahan,项目名称:Cats-Adventure-Free-Example-Unity,代码行数:31,代码来源:GPGSPostBuild.cs
示例9: OnPostprocessBuild
public static void OnPostprocessBuild(BuildTarget target,
string pathToBuildProject)
{
if (target != BuildTarget.iOS)
{
return;
}
string script = "CountlyXCodePostprocessor.py";
string pathToXCodeProject = GetXCodeProjectPath(pathToBuildProject);
string args = String.Format("\"{0}\"", pathToXCodeProject);
string result;
int exitCode;
try
{
exitCode = ExecuteScript(script, args, out result);
}
catch (Exception e)
{
Debug.LogError("CountlyPostprocessor: Could not execute " +
script + "! Make sure the script has executable permissions!\n" +
"Exception: (" + e + ")");
return;
}
if ((exitCode != 0) || (string.IsNullOrEmpty(result)))
{
Debug.LogError("CountlyPostprocessor: Postprocess failed: " + result);
return;
}
Debug.Log(result);
}
开发者ID:ramyD,项目名称:countly-sdk-unity,代码行数:34,代码来源:CountlyPostprocessor.cs
示例10: OnPostprocessBuild
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
{
string baseFolder = pathToBuiltProject.Substring(0, pathToBuiltProject.Length - 4) + "_Data/";
Debug.Log( "BuiltProject path " + baseFolder );
Debug.Log ("Copying files...");
Directory.CreateDirectory(baseFolder + "Composition/FiniteStateMachines");
string[] fsms = Directory.GetFiles(Application.dataPath + "/Composition/FiniteStateMachines", "*.tgf");
foreach (string tgfFile in fsms)
{
string fileName = Path.GetFileName(tgfFile);
File.Copy (tgfFile, baseFolder + "Composition/FiniteStateMachines/" + fileName);
}
Directory.CreateDirectory(baseFolder + "Composition/PathfindingGraphs");
string[] graphs = Directory.GetFiles(Application.dataPath + "/Composition/PathfindingGraphs", "*.tgf");
foreach (string tgfFile in graphs)
{
string fileName = Path.GetFileName(tgfFile);
File.Copy (tgfFile, baseFolder + "Composition/PathfindingGraphs/" + fileName);
}
Debug.Log ("Copying files... DONE!");
}
开发者ID:CianciuStyles,项目名称:angrybots-jaco,代码行数:26,代码来源:MyBuildPostProcess.cs
示例11: OnPostExportBuild
public static void OnPostExportBuild(BuildTarget buildTarget, string path)
{
#if !UNITY_CLOUD_BUILD
Debug.Log("[Editor] OnPostExportBuild started.");
ProcessPostBuild(buildTarget, path);
#endif
}
开发者ID:unitychrism,项目名称:XCodeDebugExample,代码行数:7,代码来源:PostProcessor.cs
示例12: GetPlatformForAssetBundles
private static string GetPlatformForAssetBundles(BuildTarget target)
{
switch(target)
{
case BuildTarget.Android:
return "Android";
case BuildTarget.iOS:
return "iOS";
case BuildTarget.WebGL:
return "WebGL";
case BuildTarget.WebPlayer:
return "WebPlayer";
case BuildTarget.StandaloneWindows:
case BuildTarget.StandaloneWindows64:
return "Windows";
case BuildTarget.StandaloneOSXIntel:
case BuildTarget.StandaloneOSXIntel64:
case BuildTarget.StandaloneOSXUniversal:
return "OSX";
// Add more build targets for your own.
// If you add more targets, don't forget to add the same platforms to GetPlatformForAssetBundles(RuntimePlatform) function.
default:
return null;
}
}
开发者ID:yuisunn,项目名称:UnityCrazy,代码行数:25,代码来源:Utility.cs
示例13: OnPostprocessBuild
public static void OnPostprocessBuild(BuildTarget target, string pathToBuildProject)
{
if (target == BuildTarget.tvOS) {
UnityEngine.Debug.Log ("[SPIL] Starting custom post process build script." + pathToBuildProject);
UnityEngine.Debug.Log ("[SPIL] Moving SpilTV.framework to the root of the project");
MoveDirectory (pathToBuildProject + "/Frameworks/Plugins/tvOS/SpilTV.framework", pathToBuildProject + "/SpilTV.framework");
bool exportDefaultEntitlements = EditorPrefs.GetBool ("exportDefaultEntitlements");
bool useICloudContainer = EditorPrefs.GetBool ("useICloudContainer");
bool useICloudKV = EditorPrefs.GetBool ("useICloudKV");
bool usePushNotifications = EditorPrefs.GetBool ("usePushNotifications");
String arguments = "Unity-iPhone " +
exportDefaultEntitlements + " " +
useICloudContainer + " " +
useICloudKV + " " +
usePushNotifications;
UnityEngine.Debug.Log ("[SPIL] Executing: python " + pathToBuildProject + "/SpilTV.framework/setup.py " + arguments);
Process setupProcess = new Process ();
setupProcess.StartInfo.WorkingDirectory = pathToBuildProject;
setupProcess.StartInfo.FileName = "python";
setupProcess.StartInfo.Arguments = "SpilTV.framework/setup.py " + arguments;
setupProcess.StartInfo.UseShellExecute = false;
setupProcess.StartInfo.RedirectStandardOutput = true;
setupProcess.Start ();
setupProcess.WaitForExit ();
UnityEngine.Debug.Log ("[SPIL] --> Setup.py output: " + setupProcess.StandardOutput.ReadToEnd ());
UnityEngine.Debug.Log ("[SPIL] Custom post process build script finished executing!");
}
}
开发者ID:spilgames,项目名称:spil_event_unity_plugin,代码行数:34,代码来源:TVOSBuildPostProcess.cs
示例14: PlatformArchitecture
public PlatformArchitecture(string name, string binarySuffix, BuildTarget buildTarget, bool isActive = false)
{
this.name = name;
this.binarySuffix = binarySuffix;
this.buildTarget = buildTarget;
this.isActive = isActive;
}
开发者ID:smclallen,项目名称:Galactic_Parcel_Service,代码行数:7,代码来源:PlatformArchitecture.cs
示例15: CreateBaseCharacter
static void CreateBaseCharacter(BuildTarget target)
{
foreach (Object obj in Selection.GetFiltered(typeof(Object), SelectionMode.DeepAssets))
{
// If the object is not GameObject, then skip this object
if ((obj is GameObject) == false)
{
continue;
}
// If the object is of animation prefab type, then skip this object
if (obj.name.Contains("@"))
{
continue;
}
if (obj is Texture2D) continue;
string name = obj.name.ToLower();
GameObject go = (GameObject)obj;
GenerateBaseCharacter(go, name, target);
}
}
开发者ID:azanium,项目名称:PopBloop-Unity,代码行数:25,代码来源:SACreateBaseCharacterBundles.cs
示例16: RunIntegrationTests
public static void RunIntegrationTests(BuildTarget? targetPlatform, List<string> testScenes, List<string> otherBuildScenes)
{
if (targetPlatform.HasValue)
BuildAndRun(targetPlatform.Value, testScenes, otherBuildScenes);
else
RunInEditor(testScenes, otherBuildScenes);
}
开发者ID:RichLogan,项目名称:CiscoSpark-UnitySDK,代码行数:7,代码来源:Batch.cs
示例17: BuildAssetResource
/// <summary>
/// 生成绑定素材
/// </summary>
public static void BuildAssetResource(BuildTarget target)
{
if (Directory.Exists(Util.DataPath)) {
Directory.Delete(Util.DataPath, true);
}
string streamPath = Application.streamingAssetsPath;
if (Directory.Exists(streamPath)) {
Directory.Delete(streamPath, true);
}
Directory.CreateDirectory(streamPath);
AssetDatabase.Refresh();
maps.Clear();
if (AppConst.LuaBundleMode) {
HandleLuaBundle();
} else {
HandleLuaFile();
}
if (AppConst.ExampleMode) {
HandleExampleBundle();
}
string resPath = "Assets/" + AppConst.AssetDir;
BuildAssetBundleOptions options = BuildAssetBundleOptions.DeterministicAssetBundle |
BuildAssetBundleOptions.UncompressedAssetBundle;
BuildPipeline.BuildAssetBundles(resPath, maps.ToArray(), options, target);
BuildFileIndex();
string streamDir = Application.dataPath + "/" + AppConst.LuaTempDir;
if (Directory.Exists(streamDir)) Directory.Delete(streamDir, true);
AssetDatabase.Refresh();
}
开发者ID:xlwangcs,项目名称:LuaFramework_UGUI,代码行数:34,代码来源:Packager.cs
示例18: OnGUI
void OnGUI()
{
_buildTarget = (BuildTarget)EditorGUILayout.EnumPopup("BuildTarget: ", _buildTarget);
EditorGUILayout.BeginHorizontal();
if(GUILayout.Button("打包DLL资源", GUILayout.Width(100), GUILayout.Height(50)))
{
_CreateAssetBundle(_assetsRoot + _bundleResRoot + _bundleDll + "/", _assetsRoot + _bundleRoot + _bundleDll + _bundleExt);
AssetDatabase.Refresh();
}
if (GUILayout.Button("打包GUI资源", GUILayout.Width(100), GUILayout.Height(50)))
{
_CreateAssetBundle(_assetsRoot + _bundleResRoot + _bundleGUI + "/", _assetsRoot + _bundleRoot + _bundleGUI + _bundleExt);
AssetDatabase.Refresh();
}
if (GUILayout.Button("打包CONFIG资源", GUILayout.Width(100), GUILayout.Height(50)))
{
_CreateAssetBundle(_assetsRoot + _bundleResRoot + _bundleCFG + "/", _assetsRoot + _bundleRoot + _bundleCFG + _bundleExt);
AssetDatabase.Refresh();
}
if (GUILayout.Button("打包所有资源", GUILayout.Width(100), GUILayout.Height(50)))
{
_CreateAssetBundle(_assetsRoot + _bundleResRoot + _bundleDll + "/", _assetsRoot + _bundleRoot + _bundleDll + _bundleExt);
_CreateAssetBundle(_assetsRoot + _bundleResRoot + _bundleGUI + "/", _assetsRoot + _bundleRoot + _bundleGUI + _bundleExt);
_CreateAssetBundle(_assetsRoot + _bundleResRoot + _bundleCFG + "/", _assetsRoot + _bundleRoot + _bundleCFG + _bundleExt);
AssetDatabase.Refresh();
}
EditorGUILayout.EndHorizontal();
}
开发者ID:fuutou89,项目名称:AngeVierge,代码行数:32,代码来源:BundleBuilder.cs
示例19: OnPostProcessBuild
public static void OnPostProcessBuild(BuildTarget target, string path)
{
if (target == BuildTarget.iOS)
{
// Get target for Xcode project
string projPath = PBXProject.GetPBXProjectPath(path);
PBXProject proj = new PBXProject();
proj.ReadFromString(File.ReadAllText(projPath));
string targetName = PBXProject.GetUnityTargetName();
string projectTarget = proj.TargetGuidByName(targetName);
// Add dependencies
proj.AddFrameworkToProject(projectTarget, "AssetsLibrary.framework", false);
proj.AddFrameworkToProject(projectTarget, "CoreText.framework", false);
proj.AddFrameworkToProject(projectTarget, "MobileCoreServices.framework", false);
proj.AddFrameworkToProject(projectTarget, "QuickLook.framework", false);
proj.AddFrameworkToProject(projectTarget, "Security.framework", false);
File.WriteAllText(projPath, proj.WriteToString());
InsertAuthCodeIntoControllerClass(path);
InsertUILoadedCallbackIntoControllerClass(path);
}
}
开发者ID:TonnyQ,项目名称:HockeySDK-Unity-iOS,代码行数:26,代码来源:PostBuildTrigger.cs
示例20: OnGroupAtlases
public void OnGroupAtlases(BuildTarget target, PackerJob job, int[] textureImporterInstanceIDs)
{
List<Entry> entries = new List<Entry>();
foreach (int instanceID in textureImporterInstanceIDs)
{
TextureImporter ti = EditorUtility.InstanceIDToObject(instanceID) as TextureImporter;
//TextureImportInstructions ins = new TextureImportInstructions();
//ti.ReadTextureImportInstructions(ins, target);
TextureImporterSettings tis = new TextureImporterSettings();
ti.ReadTextureSettings(tis);
Sprite[] sprites = AssetDatabase.LoadAllAssetRepresentationsAtPath(ti.assetPath).Select(x => x as Sprite).Where(x => x != null).ToArray();
foreach (Sprite sprite in sprites)
{
//在这里设置每个图集的参数
Entry entry = new Entry();
entry.sprite = sprite;
entry.settings.format = (TextureFormat)Enum.Parse(typeof(TextureFormat), ParseTextuerFormat(ti.spritePackingTag).ToString());
entry.settings.filterMode = FilterMode.Bilinear;
entry.settings.colorSpace = ColorSpace.Linear;
entry.settings.compressionQuality = (int)TextureCompressionQuality.Normal;
entry.settings.filterMode = Enum.IsDefined(typeof(FilterMode), ti.filterMode) ? ti.filterMode : FilterMode.Bilinear;
entry.settings.maxWidth = ParseTextureWidth(ti.spritePackingTag);
entry.settings.maxHeight = ParseTextureHeight(ti.spritePackingTag);
entry.atlasName = ParseAtlasName(ti.spritePackingTag);
entry.packingMode = GetPackingMode(ti.spritePackingTag, tis.spriteMeshType);
entries.Add(entry);
}
Resources.UnloadAsset(ti);
}
var atlasGroups =
from e in entries
group e by e.atlasName;
foreach (var atlasGroup in atlasGroups)
{
int page = 0;
// Then split those groups into smaller groups based on texture settings
var settingsGroups =
from t in atlasGroup
group t by t.settings;
foreach (var settingsGroup in settingsGroups)
{
string atlasName = atlasGroup.Key;
if (settingsGroups.Count() > 1)
atlasName += string.Format(" (Group {0})", page);
job.AddAtlas(atlasName, settingsGroup.Key);
foreach (Entry entry in settingsGroup)
{
job.AssignToAtlas(atlasName, entry.sprite, entry.packingMode, SpritePackingRotation.None);
}
++page;
}
}
}
开发者ID:l980305284,项目名称:UGUIPlugin,代码行数:60,代码来源:PackerPolicyByLiuJing.cs
注:本文中的BuildTarget类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论