private Platform convertPlatform(EditorPlatform platform) { switch (platform) { case EditorPlatform.iPhone: return(Platform.iPhone); case EditorPlatform.WebPlayer: return(Platform.WebPlayer); case EditorPlatform.iPad: return(Platform.iPad); case EditorPlatform.iPhoneRetina: return(Platform.iPhoneRetina); case EditorPlatform.Standalone: return(Platform.Standalone); case EditorPlatform.Android: return(Platform.Android); case EditorPlatform.FlashPlayer: return(Platform.FlashPlayer); case EditorPlatform.NaCl: return(Platform.NaCl); case EditorPlatform.iPadRetina: return(Platform.iPadRetina); case EditorPlatform.iPhone5: return(Platform.iPhone5); case EditorPlatform.WP8: return(Platform.WP8); case EditorPlatform.Windows8: return(Platform.Windows8); default: Debug.LogError("Unable to convert EditorPlatform to Platform!"); return(Platform.iPhone); } }
void OnEnable() { currentPlatform = (Platform)System.Enum.Parse(typeof(Platform), EditorPrefs.GetString(Platforms.editorPlatformOverrideKey, "Standalone")); if (currentPlatform == Platform.iOS) { currentPlatform = Platform.iPhone; } currentEditorPlatform = convertPlatform(currentPlatform); minSize = new Vector2(160, 20); maxSize = new Vector2(300, 40); }
void OnGUI() { currentEditorPlatform = (EditorPlatform)EditorGUILayout.EnumPopup("Platform: ", (System.Enum)currentEditorPlatform); currentPlatform = convertPlatform(currentEditorPlatform); if (GUI.changed) { EditorPrefs.SetString(Platforms.editorPlatformOverrideKey, currentPlatform.ToString()); } // apply changes to scene if (GUILayout.Button("Apply To Scene")) { applyPlatformToScene(); } }
private Platform convertPlatform(EditorPlatform platform) { switch (platform) { case EditorPlatform.iPhone: return Platform.iPhone; case EditorPlatform.WebPlayer: return Platform.WebPlayer; case EditorPlatform.iPad: return Platform.iPad; case EditorPlatform.iPhoneRetina: return Platform.iPhoneRetina; case EditorPlatform.Standalone: return Platform.Standalone; case EditorPlatform.Android: return Platform.Android; case EditorPlatform.FlashPlayer: return Platform.FlashPlayer; case EditorPlatform.NaCl: return Platform.NaCl; case EditorPlatform.iPadRetina: return Platform.iPadRetina; case EditorPlatform.iPhone5: return Platform.iPhone5; case EditorPlatform.WP8: return Platform.WP8; case EditorPlatform.Windows8: return Platform.Windows8; default: Debug.LogError("Unable to convert EditorPlatform to Platform!"); return Platform.iPhone; } }
private static void DeterminePlatform() { editorPlatform = EditorPlatform.None; platform = Platform.Unknown; webplayerPlatform = WebplayerPlatform.None; isEditor = false; // Find out the platform #if UNITY_EDITOR isEditor = true; editorPlatform = EditorPlatform.Unknown; #endif #if UNITY_EDITOR_WIN editorPlatform = EditorPlatform.Windows; #endif #if UNITY_EDITOR_OSX editorPlatform = EditorPlatform.OSX; #endif #if UNITY_STANDALONE_OSX platform = Platform.OSX; #endif #if UNITY_DASHBOARD_WIDGET #endif #if UNITY_STANDALONE_WIN platform = Platform.Windows; #endif #if UNITY_STANDALONE_LINUX platform = Platform.Linux; #endif #if UNITY_STANDALONE #endif #if UNITY_ANDROID platform = Platform.Android; #endif #if UNITY_BLACKBERRY platform = Platform.Blackberry; #endif #if UNITY_WP8 platform = Platform.WindowsPhone8; #endif #if UNITY_IPHONE platform = Platform.iOS; #endif #if UNITY_IOS platform = Platform.iOS; #endif #if UNITY_PS3 platform = Platform.PS3; #endif #if UNITY_PS4 platform = Platform.PS4; #endif #if UNITY_PSP2 platform = Platform.PSVita; #endif #if UNITY_PSM platform = Platform.PSMobile; #endif #if UNITY_XBOX360 platform = Platform.Xbox360; #endif #if UNITY_XBOXONE platform = Platform.XboxOne; #endif #if UNITY_WII platform = Platform.Wii; #endif #if UNITY_WIIU platform = Platform.WiiU; #endif #if UNITY_FLASH platform = Platform.Flash; #endif #if UNITY_METRO platform = Platform.WindowsAppStore; #endif #if UNITY_WINRT #endif #if UNITY_WEBGL platform = Platform.WebGL; #endif // Check if Webplayer #if UNITY_WEBPLAYER webplayerPlatform = UnityTools.DetermineWebplayerPlatformType(platform, editorPlatform); // call this BEFORE you change the platform so we still know what base system this is platform = Platform.Webplayer; #endif }
private static void DeterminePlatform() { editorPlatform = EditorPlatform.None; platform = Platform.Unknown; webplayerPlatform = WebplayerPlatform.None; isEditor = false; // Find out the platform #if UNITY_EDITOR isEditor = true; editorPlatform = EditorPlatform.Unknown; #endif #if UNITY_EDITOR_WIN editorPlatform = EditorPlatform.Windows; #endif #if UNITY_EDITOR_OSX editorPlatform = EditorPlatform.OSX; #endif #if UNITY_STANDALONE_OSX platform = Platform.OSX; #endif #if UNITY_DASHBOARD_WIDGET #endif #if UNITY_STANDALONE_WIN platform = Platform.Windows; #endif #if UNITY_STANDALONE_LINUX platform = Platform.Linux; #endif #if UNITY_STANDALONE #endif #if UNITY_ANDROID platform = Platform.Android; #endif #if UNITY_BLACKBERRY platform = Platform.Blackberry; #endif #if UNITY_WP8 platform = Platform.WindowsPhone8; #endif #if UNITY_IPHONE platform = Platform.iOS; #endif #if UNITY_IOS platform = Platform.iOS; #endif #if UNITY_PS3 platform = Platform.PS3; #endif #if UNITY_PS4 platform = Platform.PS4; #endif #if UNITY_PSP2 platform = Platform.PSVita; #endif #if UNITY_PSM platform = Platform.PSMobile; #endif #if UNITY_XBOX360 platform = Platform.Xbox360; #endif #if UNITY_XBOXONE platform = Platform.XboxOne; #endif #if UNITY_WII platform = Platform.Wii; #endif #if UNITY_WIIU platform = Platform.WiiU; #endif #if UNITY_FLASH platform = Platform.Flash; #endif #if UNITY_METRO platform = Platform.WindowsAppStore; #endif #if UNITY_WINRT #endif #if UNITY_WEBGL platform = Platform.WebGL; #endif // Check if Webplayer #if UNITY_WEBPLAYER webplayerPlatform = UnityTools.DetermineWebplayerPlatformType(platform, editorPlatform); // call this BEFORE you change the platform so we still know what base system this is platform = Platform.Webplayer; #endif }
void OnGUI() { currentEditorPlatform = (EditorPlatform)EditorGUILayout.EnumPopup("Platform: ", (System.Enum)currentEditorPlatform); currentPlatform = convertPlatform(currentEditorPlatform); if(GUI.changed) { EditorPrefs.SetString(Platforms.editorPlatformOverrideKey, currentPlatform.ToString()); } // apply changes to scene if (GUILayout.Button("Apply To Scene")) applyPlatformToScene(); }
void OnEnable() { currentPlatform = (Platform) System.Enum.Parse(typeof(Platform), EditorPrefs.GetString(Platforms.editorPlatformOverrideKey, "Standalone")); if (currentPlatform == Platform.iOS) currentPlatform = Platform.iPhone; currentEditorPlatform = convertPlatform(currentPlatform); minSize = new Vector2(160, 20); maxSize = new Vector2(300, 40); }