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


C# BuildTarget.ToString方法代码示例

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


在下文中一共展示了BuildTarget.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnPostprocessBuild

		public static void OnPostprocessBuild(BuildTarget buildTarget, string buildPath) {
			// BuiltTarget.iOS is not defined in Unity 4, so we just use strings here
			if (buildTarget.ToString () == "iOS" || buildTarget.ToString () == "iPhone") {
				PrepareProject (buildPath);
				PreparePlist (buildPath);
			}
		}
开发者ID:AnotherGameCompany,项目名称:FC-BlazeIt,代码行数:7,代码来源:FabricPostBuildiOS.cs

示例2: OnPostProcessBuild

        public static void OnPostProcessBuild(BuildTarget target, string path)
        {
            // If integrating with facebook on any platform, throw a warning if the app id is invalid
            if (!Facebook.Unity.FacebookSettings.IsValidAppId)
            {
                Debug.LogWarning("You didn't specify a Facebook app ID.  Please add one using the Facebook menu in the main Unity editor.");
            }
            // Unity renamed build target from iPhone to iOS in Unity 5, this keeps both versions happy
            if (target.ToString() == "iOS" || target.ToString() == "iPhone")
            {
                UpdatePlist(path);
                FixupFiles.FixSimulator(path);
                FixupFiles.AddVersionDefine(path);
                FixupFiles.FixColdStart(path);
            }

            if (target == BuildTarget.Android)
            {
                // The default Bundle Identifier for Unity does magical things that causes bad stuff to happen
                if (PlayerSettings.bundleIdentifier == "com.Company.ProductName")
                {
                    Debug.LogError("The default Unity Bundle Identifier (com.Company.ProductName) will not work correctly.");
                }
                if (!FacebookAndroidUtil.IsSetupProperly())
                {
                    Debug.LogError("Your Android setup is not correct. See Settings in Facebook menu.");
                }

                if (!ManifestMod.CheckManifest())
                {
                    // If something is wrong with the Android Manifest, try to regenerate it to fix it for the next build.
                    ManifestMod.GenerateManifest();
                }
            }
        }
开发者ID:roccolangeweg,项目名称:LumniBenderOfTime,代码行数:35,代码来源:FacebookPostprocess.cs

示例3: VerifyAssembly

 protected bool VerifyAssembly(BuildTarget target, string assembly)
 {
     if ((this.m_UnsupportedAssemblies.ContainsKey("*") && this.m_UnsupportedAssemblies["*"].Contains(assembly)) || (this.m_UnsupportedAssemblies.ContainsKey(target.ToString()) && this.m_UnsupportedAssemblies[target.ToString()].Contains(assembly)))
     {
         return false;
     }
     return true;
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:8,代码来源:BuildVerifier.cs

示例4: OnPostprocessBuild

 static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
 {
     if (LunarConsoleSettings.consoleEnabled)
     {
         if (target.ToString() == "iOS" || target.ToString() == "iPhone")
         {
             OnPostprocessIOS(pathToBuiltProject);
         }
     }
 }
开发者ID:Barnaff,项目名称:Chromania,代码行数:10,代码来源:BuildPostProcessor.cs

示例5: OnPostprocessBuild

		public static void OnPostprocessBuild(BuildTarget buildTarget, string buildPath)
		{
			if (!IsKitOnboarded ("Crashlytics")) {
				Fabric.Internal.Editor.Utils.Warn ("Crashlytics not yet onboarded, skipping post-build steps.");
				return;
			}

			// BuiltTarget.iOS is not defined in Unity 4, so we just use strings here
			if (buildTarget.ToString () == "iOS" || buildTarget.ToString () == "iPhone") {
				CheckiOSVersion ();

				PrepareProject (buildPath);
				PreparePlist (buildPath);
			}
		}
开发者ID:AnotherGameCompany,项目名称:FC-BlazeIt,代码行数:15,代码来源:CrashlyticsPostBuildiOS.cs

示例6: OnPostprocessBuild

    public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
    {
        if(target.ToString()=="StandaloneWindows"){

            string gmlFileName = "my_gestures.gml";
            string coreDllFileName = "GestureworksCore32.dll";

            string pathToNewDataFolder = "";
            string pathToAssetsFolder = UnityEngine.Application.dataPath;
            pathToAssetsFolder = pathToAssetsFolder.Replace("/", "\\");

            //destination /Bin folder
            string[] pathPieces = pathToBuiltProject.Split("/".ToCharArray() );
            string exeName = pathPieces[pathPieces.Length-1];

            exeName = exeName.Trim(".exe".ToCharArray()); // extract the name of the exe to use with the name of the data folder
            for(int i=1; i<pathPieces.Length; i++){
                pathToNewDataFolder += pathPieces[i-1]+"\\"; // this will grab everything except for the last
            }
            pathToNewDataFolder += exeName+"_Data\\";
            //Debug.Log("pathToAssetsFolder: "+pathToAssetsFolder);
            //Debug.Log("pathToNewDataFolder: "+pathToNewDataFolder);

            //PostBuildProcessor window = EditorWindow.GetWindow<PostBuildProcessor> ("Post Build Options");
            FileUtil.CopyFileOrDirectory(pathToAssetsFolder+"\\MyScripts\\"+gmlFileName, pathToNewDataFolder+gmlFileName);
            FileUtil.CopyFileOrDirectory(pathToAssetsFolder+"\\Plugins\\Gestureworks\\Core\\"+coreDllFileName, pathToNewDataFolder+coreDllFileName);

        } else {
            //Debug.Log("Only the Windows platform is supported only with Gestureworks");
        }
    }
开发者ID:cassab,项目名称:Decorato_Sketching,代码行数:31,代码来源:PostBuildProcessor.cs

示例7: OnPostProcessBuild

		public static void OnPostProcessBuild( BuildTarget target, string pathToBuiltProject )
		{
			string 	_targetStr	= target.ToString();

			if (!(_targetStr.Equals("iOS") || _targetStr.Equals("iPhone")))
			{
				Debug.LogWarning("Target is not iPhone. XCodePostProcess will not run");
				return;
			}

			// Create a new project object from build target
			XCProject project = new XCProject( pathToBuiltProject );

			// Find and run through all xcodemods files to patch the project.
			// Please pay attention that ALL xcodemods files in your project folder will be excuted!
			string[] files = Directory.GetFiles( Utility.AssetsUtility.GetProjectPath(), "*.xcodemods", SearchOption.AllDirectories );
			foreach( string file in files ) {
				UnityEngine.Debug.Log("Xcodemods File: "+file);
				project.ApplyMod( file );
			}

			//TODO implement generic settings as a module option
	//		project.overwriteBuildSetting("CODE_SIGN_IDENTITY[sdk=iphoneos*]", "iPhone Distribution", "Release");
			
			// Finally save the xcode project
			project.Save();

		}
开发者ID:noahzaozao,项目名称:UnityAdmobAppEventDemo,代码行数:28,代码来源:XCodePostProcess.cs

示例8: ChangePlatform

        public static void ChangePlatform(BuildTarget desiredPlatform)
        {
            if (!EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo())
            {
                // They hit cancel in the save dialog
                return;
            }

            if (ProjenyEditorUtil.GetPlatformFromDirectoryName() == desiredPlatform)
            {
                UnityEngine.Debug.Log("Projeny: Already at the desired platform, no need to change project.");
                return;
            }

            var result = PrjInterface.RunPrj(PrjInterface.CreatePrjRequestForPlatform("updateLinks", desiredPlatform));

            if (result.Succeeded)
            {
                result = PrjInterface.RunPrj(PrjInterface.CreatePrjRequestForPlatform("openUnity", desiredPlatform));
            }

            if (result.Succeeded)
            {
                EditorApplication.Exit(0);
            }
            else
            {
                DisplayPrjError(
                    "Changing platform to '{0}'"
                    .Fmt(desiredPlatform.ToString()), result.ErrorMessage);
            }
        }
开发者ID:Cyberbanan,项目名称:Projeny,代码行数:32,代码来源:PrjHelper.cs

示例9: BuildBundles

 private static void BuildBundles(BuildTarget target)
 {
     BuildAssetBundleOptions assetBundleOptions = BuildAssetBundleOptions.DeterministicAssetBundle;
     string path = DirectoryUtility.AssetBundles() + "/" + target.ToString();
     Directory.CreateDirectory(path);
     BuildPipeline.BuildAssetBundles(path, assetBundleOptions, target);
 }
开发者ID:rygo6,项目名称:VisualizationFramework-Unity,代码行数:7,代码来源:AssetBundleBuild.cs

示例10: OnPostProcessBuild

        public static void OnPostProcessBuild(BuildTarget target, string path)
        {
            // If integrating with facebook on any platform, throw a warning if the app id is invalid
            if (!FBSettings.IsValidAppId)
            {
                Debug.LogWarning("You didn't specify a Facebook app ID.  Please add one using the Facebook menu in the main Unity editor.");
            }
			// Unity renamed build target from iPhone to iOS in Unity 5, this keeps both versions happy
			if (target.ToString() == "iOS" || target.ToString() == "iPhone")
            {
                UnityEditor.XCodeEditor.XCProject project = new UnityEditor.XCodeEditor.XCProject(path);

                // Find and run through all projmods files to patch the project

                string projModPath = System.IO.Path.Combine(Application.dataPath, "Facebook/Editor/iOS");
                var files = System.IO.Directory.GetFiles(projModPath, "*.projmods", System.IO.SearchOption.AllDirectories);
                foreach (var file in files)
                {
                    project.ApplyMod(Application.dataPath, file);
                }
                project.Save();

                UpdatePlist(path);
                FixupFiles.FixSimulator(path);
                FixupFiles.AddVersionDefine(path);
                FixupFiles.FixColdStart(path);
            }

            if (target == BuildTarget.Android)
            {
                // The default Bundle Identifier for Unity does magical things that causes bad stuff to happen
                if (PlayerSettings.bundleIdentifier == "com.Company.ProductName")
                {
                    Debug.LogError("The default Unity Bundle Identifier (com.Company.ProductName) will not work correctly.");
                }
                if (!FacebookAndroidUtil.IsSetupProperly())
                {
                    Debug.LogError("Your Android setup is not correct. See Settings in Facebook menu.");
                }

                if (!ManifestMod.CheckManifest())
                {
                    // If something is wrong with the Android Manifest, try to regenerate it to fix it for the next build.
                    ManifestMod.GenerateManifest();
                }
            }
        }
开发者ID:NathanSDunn,项目名称:aws-sdk-unity-samples,代码行数:47,代码来源:FacebookPostprocess.cs

示例11: BuildBundle

    static void BuildBundle(string path, BuildTarget target)
    {
        if (!Directory.Exists (path))
            Directory.CreateDirectory (path);

        BuildPipeline.BuildAssetBundles (path, BuildAssetBundleOptions.None, target);
        Debug.Log (target.ToString ());
    }
开发者ID:kazuooooo,项目名称:Unity5AssetBundleSampleProject,代码行数:8,代码来源:AssetBundleMenu.cs

示例12: BuildPlayer

        string BuildPlayer(BuildTarget target, BuildOptions options, params string[] levels)
        {
            var output = Path.Combine(OutputDir, target.ToString());
            DirectoryEx.DeleteDirectory(output);

            BuildPipeline.BuildPlayer(levels, output, target,  options);
            return output;
        }
开发者ID:learnUnity,项目名称:AssetBundlePatch,代码行数:8,代码来源:OneBuilderEditor.cs

示例13: DrawPlatformToggle

 private void DrawPlatformToggle(BuildTarget target, string label)
 {
     // We try to make a unique key for this EditorPref variable
     string key = Prefix + target.ToString ();
     // We define false the default value of the EditorPref if this is not defined
     bool currentValue = EditorPrefs.GetBool (key, false);
     EditorPrefs.SetBool (key, GUILayout.Toggle (currentValue, label));
 }
开发者ID:angelotadres,项目名称:AppBuilder,代码行数:8,代码来源:SettingsWindow.cs

示例14: OnPostProcessBuild

		public static void OnPostProcessBuild (BuildTarget _target, string _buildPath) 
		{			
			string 	_targetStr	= _target.ToString();
			
			if (_targetStr.Equals ("iOS") || _targetStr.Equals ("iPhone"))
			{
				iOSPostProcessBuild (_target, _buildPath);
				return;
			}
		}
开发者ID:noahzaozao,项目名称:UnityAdmobAppEventDemo,代码行数:10,代码来源:PostProcessBuild.cs

示例15: OnPostProcessBuild

		public static void OnPostProcessBuild(BuildTarget build, string path)
		{
			//Make sure this build is for iOS.
			//Unity 4 uses 'iPhone' for the enum value; Unity 5 changes it to 'iOS'.
			if (build.ToString() != "iPhone" && build.ToString() != "iOS")
			{
				UnityEngine.Debug.LogWarning("Skillz cannot be set up for a platform other than iOS.");
				return;
			}
			if (Application.platform != RuntimePlatform.OSXEditor)
			{
				UnityEngine.Debug.LogError("Skillz cannot be set up for XCode automatically on a platform other than OSX.");
				return;
			}
			
			//Get whether this is an append build by checking whether a custom file has already been created.
			//If it is, then nothing needs to be modified.
			string checkAppendFilePath = Path.Combine(path, checkAppendFileName);
			FileInfo checkAppend = new FileInfo(checkAppendFilePath);
			if (checkAppend.Exists)
			{
				return;
			}
			
			checkAppend.Create().Close();
			
			bool trySetUp = SetUpOrientation(path) && SetUpSDKFiles(path);
			if (!trySetUp)
			{
				//These failures aren't fatal; the developer can do them manually.
				UnityEngine.Debug.LogWarning("Skillz automated steps failed!");
			}

			//Set up XCode project settings.
			SkillzXCProjEdit editProj = SkillzXCProjEdit.LoadXCProj(path);
			if (editProj == null ||
			    !editProj.AddLinkerFlags() || !editProj.AddSkillzFiles() || !editProj.AddRunScript() ||
			    !editProj.SaveChanges())
			{
				UnityEngine.Debug.LogError("Skillz automated XCode editing failed!");
				return;
			}
		}
开发者ID:JamesMcMahon,项目名称:example-ios-unity,代码行数:43,代码来源:SkillzPostProcess.cs


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