本文整理汇总了C#中BuildTargetGroup类的典型用法代码示例。如果您正苦于以下问题:C# BuildTargetGroup类的具体用法?C# BuildTargetGroup怎么用?C# BuildTargetGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BuildTargetGroup类属于命名空间,在下文中一共展示了BuildTargetGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnGUI
// Use this for initialization
void OnGUI()
{
bool guiDisable = EditorApplication.isCompiling || EditorApplication.isPlayingOrWillChangePlaymode;
EditorGUI.BeginDisabledGroup( guiDisable );
EditorGUI.BeginChangeCheck();
targetGroup = (BuildTargetGroup)EditorGUILayout.EnumPopup( "target", targetGroup );
romMode = (RomMode)EditorGUILayout.EnumPopup( "romMode", romMode );
classDebugMode = (ClassDebugMode)EditorGUILayout.EnumPopup( "classDebugMode", classDebugMode );
if( EditorGUI.EndChangeCheck() )
{
var tmpSymbols = CreateSymbols();
PlayerSettings.SetScriptingDefineSymbolsForGroup( targetGroup, tmpSymbols );
}
var symbols = PlayerSettings.GetScriptingDefineSymbolsForGroup( targetGroup );
GUI.enabled = true;
var newSymbols = EditorGUILayout.TextArea( symbols, GUILayout.ExpandHeight( true ) );
GUI.enabled = !guiDisable;
if( symbols != newSymbols )
{
PlayerSettings.SetScriptingDefineSymbolsForGroup( targetGroup, newSymbols );
}
var scenes = EditorBuildSettings.scenes;
foreach( var scene in scenes )
{
GUILayout.Label( scene.path + " " + scene.enabled );
}
EditorGUI.EndDisabledGroup();
}
示例2: EvaluateCustomArgs
static void EvaluateCustomArgs(BuildTarget buildTarget, BuildTargetGroup buildTargetGroup)
{
/*Dictionary<string,string> customArgsDict = CommandLineReader.GetCustomArguments();
foreach (KeyValuePair<string, string> entry in customArgsDict)
{
Debug.Log("AutoBuilder.cs - EvaluateCustomArgs() - Key = [" + entry.Key + "] / Value = [" + entry.Value + "]");
}
//Version
if (customArgsDict.ContainsKey("Version"))
{
PlayerSettings.bundleVersion = customArgsDict["Version"];
}
else
{
Debug.LogWarning("AutoBuilder.cs - EvaluateCustomArgs() - No version number has been provided.");
}
//Password
if (customArgsDict.ContainsKey("Password"))
{
SetPassword(customArgsDict["Password"]);
}
else
{
Debug.LogWarning("AutoBuilder.cs - EvaluateCustomArgs() - No password value has been provided.");
}*/
}
示例3: UndefineSymbol
public static void UndefineSymbol(string symbol, BuildTargetGroup target)
{
var defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(target);
defines = defines.Replace(symbol + ";", "");
defines = defines.Replace(";" + symbol, "");
defines = defines.Replace(symbol, "");
PlayerSettings.SetScriptingDefineSymbolsForGroup(target, defines);
}
示例4: BuildPlatform
public BuildPlatform(string locTitle, string tooltip, BuildTargetGroup targetGroup, bool forceShowTarget)
{
this.targetGroup = targetGroup;
this.name = ((targetGroup == BuildTargetGroup.Unknown) ? string.Empty : BuildPipeline.GetBuildTargetGroupName(this.DefaultTarget));
this.title = EditorGUIUtility.TextContent(locTitle);
this.smallIcon = (EditorGUIUtility.IconContent(locTitle + ".Small").image as Texture2D);
this.tooltip = tooltip;
this.forceShowTarget = forceShowTarget;
}
示例5: IsValidBuildTargetGroup
private static bool IsValidBuildTargetGroup(BuildTargetGroup group)
{
if (group == BuildTargetGroup.Unknown) return false;
#if UNITY_5_3_0 // Unity 5.3.0 had tvOS in enum but throws error if used
if ((int)(object)group == 25) return false;
#endif
return true;
}
示例6: GetShaderSettingsForPlatform
public static PlatformShaderSettings GetShaderSettingsForPlatform(BuildTargetGroup target, ShaderHardwareTier tier)
{
TierSettings tierSettings = GetTierSettings(target, (GraphicsTier) tier);
return new PlatformShaderSettings {
cascadedShadowMaps = tierSettings.cascadedShadowMaps,
standardShaderQuality = tierSettings.standardShaderQuality,
reflectionProbeBoxProjection = tierSettings.reflectionProbeBoxProjection,
reflectionProbeBlending = tierSettings.reflectionProbeBlending
};
}
示例7: DefineSymbol
public static void DefineSymbol(string symbol, BuildTargetGroup target)
{
UndefineSymbol(symbol, target);
var defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(target);
if (!defines.EndsWith(";"))
defines += ";";
defines += symbol;
PlayerSettings.SetScriptingDefineSymbolsForGroup(target, defines);
}
示例8: PlayerSettingsSetup
static PlayerSettingsSetup() {
BuildTargetGroup[] platformTargets = new BuildTargetGroup[1] { BuildTargetGroup.Standalone };
IList<string> definesToInclude = new List<string>() { "DEBUG_ERROR", "DEBUG_WARN" };
if (EditorWindow.GetWindow<DebugSettingsWindow>()._isDebugLogEnabled) {
definesToInclude.Add("DEBUG_LOG");
}
//if (DebugSettings.Instance.EnableVerboseDebug) {
// definesToInclude.Add("DEBUG_LOG");
//}
UnityEditorUtility.ResetConditionalCompilation(platformTargets, definesToInclude.ToArray<string>());
}
示例9: ShowArchitectureButton
public static void ShowArchitectureButton(BuildTargetGroup target)
{
bool flag;
if (target == BuildTargetGroup.tvOS)
{
flag = PlayerSettings.tvOS.sdkVersion == tvOSSdkVersion.Simulator;
}
else
{
flag = PlayerSettings.iOS.sdkVersion == iOSSdkVersion.SimulatorSDK;
}
int scriptingBackend = (int) PlayerSettings.GetScriptingBackend(target);
if (!flag)
{
int num3;
int architecture = PlayerSettings.GetArchitecture(target);
if (scriptingBackend == 1)
{
if (target == BuildTargetGroup.tvOS)
{
num3 = 1;
PlayerSettingsEditor.BuildDisabledEnumPopup(new GUIContent("ARM64"), EditorGUIUtility.TextContent("Architecture"));
}
else
{
num3 = PlayerSettingsEditor.BuildEnumPopup<Architecture>(EditorGUIUtility.TextContent("Architecture"), architecture, kArchitectureOrder, kArchitectureDescriptions);
}
}
else
{
num3 = 0;
PlayerSettingsEditor.BuildDisabledEnumPopup(new GUIContent("ARMv7"), EditorGUIUtility.TextContent("Architecture"));
}
if (num3 != architecture)
{
PlayerSettings.SetArchitecture(target, num3);
}
}
else if (scriptingBackend == 1)
{
PlayerSettingsEditor.BuildDisabledEnumPopup(EditorGUIUtility.TextContent("x86_64"), EditorGUIUtility.TextContent("Architecture"));
}
else
{
PlayerSettingsEditor.BuildDisabledEnumPopup(EditorGUIUtility.TextContent("i386"), EditorGUIUtility.TextContent("Architecture"));
}
}
示例10: IsValidBuildTargetGroup
private static bool IsValidBuildTargetGroup(BuildTargetGroup group)
{
if (group == BuildTargetGroup.Unknown || IsObsolete(group)) return false;
// Checking Obsolete attribute should be enough,
// but sometimes Unity versions are missing attributes
// so keeping these checks around just in case:
#if UNITY_5_3_0 // Unity 5.3.0 had tvOS in enum but throws error if used
if ((int)(object)group == 25) return false;
#endif
#if UNITY_5_4 || UNITY_5_5 // Unity 5.4+ doesn't like Wp8 and Blackberry any more
if ((int)(object)group == 15) return false;
if ((int)(object)group == 16) return false;
#endif
return true;
}
示例11: AddCompileDefine
/// <summary>
/// Attempts to add a new #define constant to the Player Settings
/// </summary>
/// <param name="newDefineCompileConstant">constant to attempt to define</param>
/// <param name="targetGroups">platforms to add this for (null will add to all platforms)</param>
public static void AddCompileDefine(string newDefineCompileConstant, BuildTargetGroup[] targetGroups = null)
{
if (targetGroups == null)
targetGroups = (BuildTargetGroup[])Enum.GetValues(typeof(BuildTargetGroup));
foreach (BuildTargetGroup grp in targetGroups)
{
if (grp == BuildTargetGroup.Unknown) //the unknown group does not have any constants location
continue;
string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(grp);
if (!defines.Contains(newDefineCompileConstant))
{
if (defines.Length > 0) //if the list is empty, we don't need to append a semicolon first
defines += ";";
defines += newDefineCompileConstant;
PlayerSettings.SetScriptingDefineSymbolsForGroup(grp, defines);
}
}
}
示例12: PreProcessor
public bool PreProcessor()
{
_routineTargetGroup = EditorUserBuildSettings.selectedBuildTargetGroup;
if (PlayerSettings.GetScriptingDefineSymbolsForGroup(_routineTargetGroup).Contains(Tag))
{
_previousDefine = true;
}
else
{
if (!string.IsNullOrEmpty(PlayerSettings.GetScriptingDefineSymbolsForGroup(_routineTargetGroup)) &&
PlayerSettings.GetScriptingDefineSymbolsForGroup(_routineTargetGroup).Length > 0)
{
PlayerSettings.SetScriptingDefineSymbolsForGroup(_routineTargetGroup, PlayerSettings.GetScriptingDefineSymbolsForGroup(_routineTargetGroup) + ";" + Tag);
}
else
{
PlayerSettings.SetScriptingDefineSymbolsForGroup(_routineTargetGroup, Tag);
}
}
return true;
}
示例13: RemoveCompileDefine
/// <summary>
/// Attempts to remove a #define constant from the Player Settings
/// </summary>
/// <param name="defineCompileConstant"></param>
/// <param name="targetGroups"></param>
public static void RemoveCompileDefine(string defineCompileConstant, BuildTargetGroup[] targetGroups = null)
{
if (targetGroups == null)
targetGroups = (BuildTargetGroup[])Enum.GetValues(typeof(BuildTargetGroup));
foreach (BuildTargetGroup grp in targetGroups)
{
string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(grp);
int index = defines.IndexOf(defineCompileConstant);
if (index < 0)
continue; //this target does not contain the define
else if (index > 0)
index -= 1; //include the semicolon before the define
//else we will remove the semicolon after the define
//Remove the word and it's semicolon, or just the word (if listed last in defines)
int lengthToRemove = Math.Min(defineCompileConstant.Length + 1, defines.Length - index);
//remove the constant and it's associated semicolon (if necessary)
defines = defines.Remove(index, lengthToRemove);
PlayerSettings.SetScriptingDefineSymbolsForGroup(grp, defines);
}
}
示例14: BuildPlatformFromTargetGroup
public BuildPlayerWindow.BuildPlatform BuildPlatformFromTargetGroup(BuildTargetGroup group)
{
int index = this.BuildPlatformIndexFromTargetGroup(group);
if (index != -1)
return this.buildPlatforms[index];
return (BuildPlayerWindow.BuildPlatform) null;
}
示例15: OnSampleSettingGUI
private void OnSampleSettingGUI(BuildTargetGroup platform, AudioImporterInspector.MultiValueStatus status, bool selectionContainsTrackerFile, ref AudioImporterInspector.SampleSettingProperties properties, bool disablePreloadAudioDataOption)
{
EditorGUI.showMixedValue = status.multiLoadType && !properties.loadTypeChanged;
EditorGUI.BeginChangeCheck();
AudioClipLoadType audioClipLoadType = (AudioClipLoadType) EditorGUILayout.EnumPopup("Load Type", (Enum) properties.settings.loadType, new GUILayoutOption[0]);
if (EditorGUI.EndChangeCheck())
{
properties.settings.loadType = audioClipLoadType;
properties.loadTypeChanged = true;
}
EditorGUI.BeginDisabledGroup(disablePreloadAudioDataOption);
if (disablePreloadAudioDataOption)
EditorGUILayout.Toggle("Preload Audio Data", false, new GUILayoutOption[0]);
else
EditorGUILayout.PropertyField(this.m_PreloadAudioData);
EditorGUI.EndDisabledGroup();
if (selectionContainsTrackerFile)
return;
AudioCompressionFormat[] formatsForPlatform = this.GetFormatsForPlatform(platform);
EditorGUI.showMixedValue = status.multiCompressionFormat && !properties.compressionFormatChanged;
EditorGUI.BeginChangeCheck();
AudioCompressionFormat compressionFormat = (AudioCompressionFormat) EditorGUILayout.IntPopup("Compression Format", (int) properties.settings.compressionFormat, Array.ConvertAll<AudioCompressionFormat, string>(formatsForPlatform, (Converter<AudioCompressionFormat, string>) (value => value.ToString())), Array.ConvertAll<AudioCompressionFormat, int>(formatsForPlatform, (Converter<AudioCompressionFormat, int>) (value => (int) value)), new GUILayoutOption[0]);
if (EditorGUI.EndChangeCheck())
{
properties.settings.compressionFormat = compressionFormat;
properties.compressionFormatChanged = true;
}
if (this.CompressionFormatHasQuality(properties.settings.compressionFormat))
{
EditorGUI.showMixedValue = status.multiQuality && !properties.qualityChanged;
EditorGUI.BeginChangeCheck();
int num = EditorGUILayout.IntSlider("Quality", (int) Mathf.Clamp(properties.settings.quality * 100f, 1f, 100f), 1, 100, new GUILayoutOption[0]);
if (EditorGUI.EndChangeCheck())
{
properties.settings.quality = 0.01f * (float) num;
properties.qualityChanged = true;
}
}
EditorGUI.showMixedValue = status.multiSampleRateSetting && !properties.sampleRateSettingChanged;
EditorGUI.BeginChangeCheck();
AudioSampleRateSetting sampleRateSetting = (AudioSampleRateSetting) EditorGUILayout.EnumPopup("Sample Rate Setting", (Enum) properties.settings.sampleRateSetting, new GUILayoutOption[0]);
if (EditorGUI.EndChangeCheck())
{
properties.settings.sampleRateSetting = sampleRateSetting;
properties.sampleRateSettingChanged = true;
}
if (properties.settings.sampleRateSetting == AudioSampleRateSetting.OverrideSampleRate)
{
EditorGUI.showMixedValue = status.multiSampleRateOverride && !properties.sampleRateOverrideChanged;
EditorGUI.BeginChangeCheck();
int num = EditorGUILayout.IntPopup("Sample Rate", (int) properties.settings.sampleRateOverride, AudioImporterInspector.Styles.kSampleRateStrings, AudioImporterInspector.Styles.kSampleRateValues, new GUILayoutOption[0]);
if (EditorGUI.EndChangeCheck())
{
properties.settings.sampleRateOverride = (uint) num;
properties.sampleRateOverrideChanged = true;
}
}
EditorGUI.showMixedValue = false;
}