当前位置: 首页>>代码示例>>C#>>正文


C# BuildTarget类代码示例

本文整理汇总了C#中BuildTarget的典型用法代码示例。如果您正苦于以下问题:C# BuildTarget类的具体用法?C# BuildTarget怎么用?C# BuildTarget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BuildTarget类属于命名空间,在下文中一共展示了BuildTarget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的BuildTarget类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。