// Render the GUI: void OnGUI() { GUI.skin = fb_GUISkin; if (dependencyStatus != Firebase.DependencyStatus.Available) { GUILayout.Label("One or more Firebase dependencies are not present."); GUILayout.Label("Current dependency status: " + dependencyStatus.ToString()); return; } GUI.skin.textArea.fontSize = GUI.skin.textField.fontSize; // Reduce the text size on the desktop. if (UnityEngine.Application.platform != RuntimePlatform.Android && UnityEngine.Application.platform != RuntimePlatform.IPhonePlayer) { GUI.skin.textArea.fontSize /= 4; GUI.skin.button.fontSize = GUI.skin.textArea.fontSize; GUI.skin.label.fontSize = GUI.skin.textArea.fontSize; } if (dependencyStatus != Firebase.DependencyStatus.Available) { GUILayout.Label("One or more Firebase dependencies are not present."); GUILayout.Label("Current dependency status: " + dependencyStatus.ToString()); return; } Rect logArea, controlArea; if (Screen.width < Screen.height) { // Portrait mode controlArea = new Rect(0.0f, 0.0f, Screen.width, Screen.height * 0.5f); logArea = new Rect(0.0f, Screen.height * 0.5f, Screen.width, Screen.height * 0.5f); } else { // Landscape mode controlArea = new Rect(0.0f, 0.0f, Screen.width * 0.4f, Screen.height); logArea = new Rect(Screen.width * 0.4f, 0.0f, Screen.width * 0.6f, Screen.height); } GUILayout.BeginArea(logArea); GUIDisplayLog(); GUILayout.EndArea(); GUILayout.BeginArea(controlArea); GUIDisplayControls(); GUILayout.EndArea(); }
// Render the GUI: void OnGUI() { GUI.skin = fb_GUISkin; if (dependencyStatus != DependencyStatus.Available) { GUILayout.Label("One or more Firebase dependencies are not present."); GUILayout.Label("Current dependency status: " + dependencyStatus.ToString()); return; } Rect logArea, controlArea; if (Screen.width < Screen.height) { // Portrait mode controlArea = new Rect(0.0f, 50.0f, Screen.width, Screen.height * 0.5f); logArea = new Rect(0.0f, Screen.height * 0.5f, Screen.width, Screen.height * 0.5f); } else { // Landscape mode controlArea = new Rect(50.0f, 0.0f, Screen.width * 0.5f, Screen.height); logArea = new Rect(Screen.width * 0.5f, 0.0f, Screen.width * 0.5f, Screen.height); } GUILayout.BeginArea(logArea); GUIDisplayLog(); GUILayout.EndArea(); GUILayout.BeginArea(controlArea); GUIDisplayControls(); GUILayout.EndArea(); }
private void Init() { if (!string.IsNullOrEmpty(MACFilter) && MACFilter [0] != '!') { adminCheck = true; isAdmin = MACFilter == NetworkConnection.GetMACAddress(); } VisualLog("IsAdmin: " + IsAdmin); DependencyStatus dependencyStatus = DependencyStatus.UnavailableOther; FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => { dependencyStatus = task.Result; ScheduleLog(dependencyStatus.ToString()); if (dependencyStatus == DependencyStatus.Available) { if (IsAdmin) { CreateNew(id); } else { id = null; InitDatabase(); } } else { ScheduleLog("Could not resolve!"); } }); }
// Render the GUI: void OnGUI() { GUI.skin = fb_GUISkin; if (dependencyStatus != Firebase.DependencyStatus.Available) { GUILayout.Label("One or more Firebase dependencies are not present."); GUILayout.Label("Current dependency status: " + dependencyStatus.ToString()); return; } // TODO(rgowman): Fix sizing on desktop. Possibly using something like the following. // Sizing in unity is a little weird; fonts that look ok on desktop // become really small on mobile, so they need to be adjusted. But we // don't support desktop just yet, so we'll skip this step for now. /* * GUI.skin.textArea.fontSize = GUI.skin.textField.fontSize; * // Reduce the text size on the desktop. * if (UnityEngine.Application.platform != RuntimePlatform.Android && * UnityEngine.Application.platform != RuntimePlatform.IPhonePlayer) { * var fontSize = GUI.skin.textArea.fontSize / 4; * GUI.skin.textArea.fontSize = fontSize; * GUI.skin.button.fontSize = fontSize; * GUI.skin.label.fontSize = fontSize; * GUI.skin.textField.fontSize = fontSize; * } * GUI.skin.textArea.stretchHeight = true; * // Calculate the height of line of text in a text area. * if (textAreaLineHeight == 0.0f) { * textAreaLineHeight = GUI.skin.textArea.CalcSize(new GUIContent("Hello World")).y; * } */ Rect logArea, controlArea; if (Screen.width < Screen.height) { // Portrait mode controlArea = new Rect(0.0f, 0.0f, Screen.width, Screen.height * 0.5f); logArea = new Rect(0.0f, Screen.height * 0.5f, Screen.width, Screen.height * 0.5f); } else { // Landscape mode controlArea = new Rect(0.0f, 0.0f, Screen.width * 0.5f, Screen.height); logArea = new Rect(Screen.width * 0.5f, 0.0f, Screen.width * 0.5f, Screen.height); } GUILayout.BeginArea(logArea); GUIDisplayLog(); if (Button("Cancel Operation", operationInProgress)) { CancelOperation(); } GUILayout.EndArea(); GUILayout.BeginArea(controlArea); GUIDisplayControls(); GUILayout.EndArea(); }
// Render the GUI: void OnGUI() { GUI.skin = fb_GUISkin; if (dependencyStatus != Firebase.DependencyStatus.Available) { GUILayout.Label("One or more Firebase dependencies are not present."); GUILayout.Label("Current dependency status: " + dependencyStatus.ToString()); return; } GUI.skin.textArea.fontSize = GUI.skin.textField.fontSize; // Reduce the text size on the desktop. if (UnityEngine.Application.platform != RuntimePlatform.Android && UnityEngine.Application.platform != RuntimePlatform.IPhonePlayer) { var fontSize = GUI.skin.textArea.fontSize / 4; GUI.skin.textArea.fontSize = fontSize; GUI.skin.button.fontSize = fontSize; GUI.skin.label.fontSize = fontSize; GUI.skin.textField.fontSize = fontSize; } GUI.skin.textArea.stretchHeight = true; // Calculate the height of line of text in a text area. if (textAreaLineHeight == 0.0f) { textAreaLineHeight = GUI.skin.textArea.CalcSize(new GUIContent("Hello World")).y; } Rect logArea, controlArea; if (Screen.width < Screen.height) { // Portrait mode controlArea = new Rect(0.0f, 0.0f, Screen.width, Screen.height * 0.5f); logArea = new Rect(0.0f, Screen.height * 0.5f, Screen.width, Screen.height * 0.5f); } else { // Landscape mode controlArea = new Rect(0.0f, 0.0f, Screen.width * 0.5f, Screen.height); logArea = new Rect(Screen.width * 0.5f, 0.0f, Screen.width * 0.5f, Screen.height); } GUILayout.BeginArea(logArea); GUIDisplayLog(); if (Button("Cancel Operation", operationInProgress)) { CancelOperation(); } GUILayout.EndArea(); GUILayout.BeginArea(controlArea); GUIDisplayControls(); GUILayout.EndArea(); }