本文整理汇总了C#中FMODPlatform类的典型用法代码示例。如果您正苦于以下问题:C# FMODPlatform类的具体用法?C# FMODPlatform怎么用?C# FMODPlatform使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FMODPlatform类属于命名空间,在下文中一共展示了FMODPlatform类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlatformLabel
string PlatformLabel(FMODPlatform platform)
{
switch(platform)
{
case FMODPlatform.Linux:
return "Linux";
case FMODPlatform.Desktop:
return "Desktop";
case FMODPlatform.Console:
return "Console";
case FMODPlatform.iOS:
return "iOS";
case FMODPlatform.Mac:
return "OSX";
case FMODPlatform.Mobile:
return "Mobile";
case FMODPlatform.PS4:
return "PS4";
case FMODPlatform.Windows:
return "Windows";
case FMODPlatform.WindowsPhone:
return "Windows Phone 8.1";
case FMODPlatform.UWP:
return "UWP";
case FMODPlatform.XboxOne:
return "XBox One";
case FMODPlatform.WiiU:
return "Wii U";
case FMODPlatform.PSVita:
return "PS Vita";
case FMODPlatform.Android:
return "Android";
case FMODPlatform.AppleTV:
return "Apple TV";
case FMODPlatform.MobileHigh:
return "High-End Mobile";
case FMODPlatform.MobileLow:
return "Low-End Mobile";
}
return "Unknown";
}
示例2: DisplayChildBool
void DisplayChildBool(string label, List<PlatformBoolSetting> settings, FMODPlatform platform)
{
bool overriden = Settings.HasSetting(settings, platform);
bool current = Settings.GetSetting(settings, platform, false);
string[] toggleChild = new string[ToggleParent.Length + 1];
Array.Copy(ToggleParent, 0, toggleChild, 1, ToggleParent.Length);
toggleChild[0] = String.Format("Inherit ({0})", ToggleParent[current ? 1 : 0]);
int next = EditorGUILayout.Popup(label, overriden ? (current ? 2 : 1) : 0, toggleChild);
if (next == 0)
{
if (overriden)
{
Settings.RemoveSetting(settings, platform);
}
}
else
{
Settings.SetSetting(settings, platform, next == 2);
}
}
示例3: AllowBankChange
private bool AllowBankChange(FMODPlatform platform)
{
// Can't do these settings on pseudo-platforms
if (platform == FMODPlatform.MobileLow || platform == FMODPlatform.MobileHigh)
{
return false;
}
return true;
}
示例4: DisplayChildInt
void DisplayChildInt(string label, List<PlatformIntSetting> settings, FMODPlatform platform, int min, int max)
{
bool overriden = Settings.HasSetting(settings, platform);
int current = Settings.GetSetting(settings, platform, 0);
EditorGUILayout.BeginHorizontal();
EditorGUILayout.PrefixLabel(label);
overriden = !GUILayout.Toggle(!overriden, "Inherit");
EditorGUI.BeginDisabledGroup(!overriden);
int next = EditorGUILayout.IntSlider(current, min, max);
EditorGUI.EndDisabledGroup();
EditorGUILayout.EndHorizontal();
if (overriden)
{
Settings.SetSetting(settings, platform, next);
}
else
{
Settings.RemoveSetting(settings, platform);
}
}
示例5: DisplayChildBuildDirectories
void DisplayChildBuildDirectories(string label, List<PlatformStringSetting> settings, FMODPlatform platform)
{
string[] buildDirectories = EditorUtils.GetBankPlatforms();
bool overriden = Settings.HasSetting(settings, platform);
string current = Settings.GetSetting(settings, platform, "Desktop");
int index = Array.IndexOf(buildDirectories, current);
if (index < 0) index = 0;
string[] valuesChild = new string[buildDirectories.Length + 1];
Array.Copy(buildDirectories, 0, valuesChild, 1, buildDirectories.Length);
valuesChild[0] = String.Format("Inherit ({0})", buildDirectories[index]);
int next = EditorGUILayout.Popup(label, overriden ? index + 1 : 0, valuesChild);
if (next == 0)
{
Settings.RemoveSetting(settings, platform);
Settings.RemoveSetting(((Settings)target).SpeakerModeSettings, platform);
}
else
{
Settings.SetSetting(settings, platform, buildDirectories[next - 1]);
}
}
示例6: DisplayPlatform
void DisplayPlatform(FMODPlatform platform, FMODPlatform[] children = null)
{
Settings settings = target as Settings;
var label = new global::System.Text.StringBuilder();
label.AppendFormat("<b>{0}</b>", (PlatformLabel(platform)));
if (children != null)
{
label.Append(" (");
foreach (var child in children)
{
label.Append(PlatformLabel(child));
label.Append(", ");
}
label.Remove(label.Length - 2, 2);
label.Append(")");
}
GUIStyle style = new GUIStyle(GUI.skin.FindStyle("Foldout"));
style.richText = true;
foldoutState[(int)platform] = EditorGUILayout.Foldout(foldoutState[(int)platform], new GUIContent(label.ToString()), style);
if (foldoutState[(int)platform])
{
EditorGUI.indentLevel++;
DisplayChildBool("Live Update", settings.LiveUpdateSettings, platform);
if (settings.IsLiveUpdateEnabled(platform))
{
GUIStyle style2 = new GUIStyle(GUI.skin.label);
style2.richText = true;
EditorGUILayout.BeginHorizontal();
EditorGUILayout.PrefixLabel(" ");
#if UNITY_5_0 || UNITY_5_1
GUILayout.Label("Unity 5.0 or 5.1 detected: Live update will listen on port <b>9265</b>", style2);
#else
GUILayout.Label("Live update will listen on port <b>9264</b>", style2);
#endif
EditorGUILayout.EndHorizontal();
}
DisplayChildBool("Debug Overlay", settings.LiveUpdateSettings, platform);
DisplayChildFreq("Sample Rate", settings.SampleRateSettings, platform);
if (settings.HasPlatforms && AllowBankChange(platform))
{
bool prevChanged = GUI.changed;
DisplayChildBuildDirectories("Bank Platform", settings.BankDirectorySettings, platform);
hasBankSourceChanged |= !prevChanged && GUI.changed;
if (Settings.HasSetting(settings.BankDirectorySettings, platform))
{
DisplayChildSpeakerMode("Speaker Mode", settings.SpeakerModeSettings, platform);
EditorGUILayout.HelpBox(String.Format("Match the speaker mode to the setting of the platform <b>{0}</b> inside FMOD Studio", settings.GetBankPlatform(platform)), MessageType.Info, false);
}
else
{
EditorGUI.BeginDisabledGroup(true);
DisplayChildSpeakerMode("Speaker Mode", settings.SpeakerModeSettings, platform);
EditorGUI.EndDisabledGroup();
}
}
DisplayChildInt("Virtual Channel Count", settings.VirtualChannelSettings, platform, 0, 2048);
DisplayChildInt("Real Channel Count", settings.RealChannelSettings, platform, 0, 2048);
if (children != null)
{
foreach (var child in children)
{
DisplayPlatform(child);
}
}
EditorGUI.indentLevel--;
}
}
示例7: DisplayChildSpeakerMode
void DisplayChildSpeakerMode(string label, List<PlatformIntSetting> settings, FMODPlatform platform)
{
bool overriden = Settings.HasSetting(settings, platform);
int current = Settings.GetSetting(settings, platform, 0);
int index = Array.IndexOf(SpeakerModeValues, current);
string[] valuesChild = new string[SpeakerModeDisplay.Length + 1];
Array.Copy(SpeakerModeDisplay, 0, valuesChild, 1, SpeakerModeDisplay.Length);
valuesChild[0] = String.Format("Inherit ({0})", SpeakerModeDisplay[index]);
int next = EditorGUILayout.Popup(label, overriden ? index + 1 : 0, valuesChild);
if (next == 0)
{
Settings.RemoveSetting(settings, platform);
}
else
{
Settings.SetSetting(settings, platform, SpeakerModeValues[next - 1]);
}
}
示例8: DisplayParentBuildDirectory
void DisplayParentBuildDirectory(string label, List<PlatformStringSetting> settings, FMODPlatform platform)
{
string[] buildDirectories = EditorUtils.GetBankPlatforms();
String current = Settings.GetSetting(settings, platform, "Desktop");
int index = Array.IndexOf(buildDirectories, current);
if (index < 0) index = 0;
int next = EditorGUILayout.Popup(label, index, buildDirectories);
Settings.SetSetting(settings, platform, buildDirectories[next]);
}
示例9: DisplayChildFreq
void DisplayChildFreq(string label, List<PlatformIntSetting> settings, FMODPlatform platform)
{
bool overriden = Settings.HasSetting(settings, platform);
int current = Settings.GetSetting(settings, platform, 0);
int inherit = Settings.GetSetting(settings, Settings.GetParent(platform), 0);
int currentIndex = Array.IndexOf(FrequencyValues, current);
int inheritIndex = Array.IndexOf(FrequencyValues, inherit);
string[] valuesChild = new string[FrequencyDisplay.Length + 1];
Array.Copy(FrequencyDisplay, 0, valuesChild, 1, FrequencyDisplay.Length);
valuesChild[0] = String.Format("Inherit ({0})", FrequencyDisplay[inheritIndex]);
int next = EditorGUILayout.Popup(label, overriden ? currentIndex + 1 : 0, valuesChild);
if (next == 0)
{
Settings.RemoveSetting(settings, platform);
}
else
{
Settings.SetSetting(settings, platform, FrequencyValues[next-1]);
}
}
示例10: DisplayParentSpeakerMode
void DisplayParentSpeakerMode(string label, List<PlatformIntSetting> settings, FMODPlatform platform)
{
int current = Settings.GetSetting(settings, platform, (int)FMOD.SPEAKERMODE.STEREO);
int index = Array.IndexOf(SpeakerModeValues, current);
int next = EditorGUILayout.Popup(label, index, SpeakerModeDisplay);
Settings.SetSetting(settings, platform, SpeakerModeValues[next]);
}
示例11: DisplayParentInt
void DisplayParentInt(string label, List<PlatformIntSetting> settings, FMODPlatform platform, int min, int max)
{
int current = Settings.GetSetting(settings, platform, 0);
int next = EditorGUILayout.IntSlider(label, current, min, max);
Settings.SetSetting(settings, platform, next);
}
示例12: DisplayParentBool
void DisplayParentBool(string label, List<PlatformBoolSetting> settings, FMODPlatform platform)
{
bool current = Settings.GetSetting(settings, platform, false);
int next = EditorGUILayout.Popup(label, current ? 1 : 0, ToggleParent);
Settings.SetSetting(settings, platform, next == 1);
}
示例13: DisplayPIESpeakerMode
void DisplayPIESpeakerMode(string label, List<PlatformIntSetting> settings, FMODPlatform platform)
{
int buildTargetSetting = Settings.GetSetting(settings, RuntimeUtils.GetEditorFMODPlatform(), (int)FMOD.SPEAKERMODE.STEREO);
int buildTargetIndex = Array.IndexOf(SpeakerModeValues, buildTargetSetting);
string[] speakerModes = new string[SpeakerModeDisplay.Length + 1];
Array.Copy(SpeakerModeDisplay, 0, speakerModes, 1, SpeakerModeDisplay.Length);
speakerModes[0] = String.Format("Current Unity Platform ({0})", SpeakerModeDisplay[buildTargetIndex]);
bool useCurrentUnity = !Settings.HasSetting(settings, platform);
int current = Settings.GetSetting(settings, platform, (int)FMOD.SPEAKERMODE.STEREO);
int index = Array.IndexOf(SpeakerModeValues, current) + 1;
if (useCurrentUnity || index < 0) index = 0;
int next = EditorGUILayout.Popup(label, index, speakerModes);
if (next != 0)
{
Settings.SetSetting(settings, platform, SpeakerModeValues[next - 1]);
}
else
{
Settings.RemoveSetting(settings, platform);
}
}
示例14: DisplayPIEBuildDirectory
void DisplayPIEBuildDirectory(string label, List<PlatformStringSetting> settings, FMODPlatform platform)
{
String buildTargetSetting = Settings.GetSetting(settings, RuntimeUtils.GetEditorFMODPlatform(), "Desktop");
string[] buildDirectories = new string[EditorUtils.GetBankPlatforms().Length + 1];
Array.Copy(EditorUtils.GetBankPlatforms(), 0, buildDirectories, 1, EditorUtils.GetBankPlatforms().Length);
buildDirectories[0] = String.Format("Current Unity Platform ({0})", buildTargetSetting);
bool useCurrentUnity = !Settings.HasSetting(settings, platform);
String current = Settings.GetSetting(settings, platform, "Desktop");
int index = Array.IndexOf(buildDirectories, current);
if (useCurrentUnity || index < 0) index = 0;
int next = EditorGUILayout.Popup(label, index, buildDirectories);
if (next != 0)
{
Settings.SetSetting(settings, platform, buildDirectories[next]);
}
else
{
Settings.RemoveSetting(settings, platform);
}
}
示例15: DisplayParentBool
void DisplayParentBool(string label, List<PlatformBoolSetting> settings, FMODPlatform platform)
{
TriStateBool current = Settings.GetSetting(settings, platform, TriStateBool.Disabled);
int next = EditorGUILayout.Popup(label, (int)current, ToggleParent);
Settings.SetSetting(settings, platform, (TriStateBool)next);
}