Here are the examples of the csharp api UnityEngine.Application.OpenURL(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
75 Examples
19
Source : ScreenshotTaker.cs
with Apache License 2.0
from activey
with Apache License 2.0
from activey
void OnGUI()
{
EditorGUILayout.LabelField ("Resolution", EditorStyles.boldLabel);
resWidth = EditorGUILayout.IntField ("Width", resWidth);
resHeight = EditorGUILayout.IntField ("Height", resHeight);
EditorGUILayout.Space();
scale = EditorGUILayout.IntSlider ("Scale", scale, 1, 15);
EditorGUILayout.HelpBox("The default mode of screenshot is crop - so choose a proper width and height. The scale is a factor " +
"to multiply or enlarge the renders without loosing quality.",MessageType.None);
EditorGUILayout.Space();
GUILayout.Label ("Save Path", EditorStyles.boldLabel);
EditorGUILayout.BeginHorizontal();
EditorGUILayout.TextField(path,GUILayout.ExpandWidth(false));
if(GUILayout.Button("Browse",GUILayout.ExpandWidth(false)))
path = EditorUtility.SaveFolderPanel("Path to Save Images",path,Application.dataPath);
EditorGUILayout.EndHorizontal();
EditorGUILayout.HelpBox("Choose the folder in which to save the screenshots ",MessageType.None);
EditorGUILayout.Space();
//isTransparent = EditorGUILayout.Toggle(isTransparent,"Transparent Background");
GUILayout.Label ("Select Camera", EditorStyles.boldLabel);
myCamera = EditorGUILayout.ObjectField(myCamera, typeof(Camera), true,null) as Camera;
if(myCamera == null)
{
myCamera = Camera.main;
}
isTransparent = EditorGUILayout.Toggle("Transparent Background", isTransparent);
EditorGUILayout.HelpBox("Choose the camera of which to capture the render. You can make the background transparent using the transparency option.",MessageType.None);
EditorGUILayout.Space();
EditorGUILayout.BeginVertical();
EditorGUILayout.LabelField ("Default Options", EditorStyles.boldLabel);
if(GUILayout.Button("Set To Screen Size"))
{
resHeight = (int)Handles.GetMainGameViewSize().y;
resWidth = (int)Handles.GetMainGameViewSize().x;
}
if(GUILayout.Button("Default Size"))
{
resHeight = 1440;
resWidth = 2560;
scale = 1;
}
EditorGUILayout.EndVertical();
EditorGUILayout.Space();
EditorGUILayout.LabelField ("Screenshot will be taken at " + resWidth*scale + " x " + resHeight*scale + " px", EditorStyles.boldLabel);
if(GUILayout.Button("Take Screenshot",GUILayout.MinHeight(60)))
{
if(path == "")
{
path = EditorUtility.SaveFolderPanel("Path to Save Images",path,Application.dataPath);
Debug.Log("Path Set");
TakeHiResShot();
}
else
{
TakeHiResShot();
}
}
EditorGUILayout.Space();
EditorGUILayout.BeginHorizontal();
if(GUILayout.Button("Open Last Screenshot",GUILayout.MaxWidth(160),GUILayout.MinHeight(40)))
{
if(lastScreenshot != "")
{
Application.OpenURL("file://" + lastScreenshot);
Debug.Log("Opening File " + lastScreenshot);
}
}
if(GUILayout.Button("Open Folder",GUILayout.MaxWidth(100),GUILayout.MinHeight(40)))
{
Application.OpenURL("file://" + path);
}
if(GUILayout.Button("More replacedets",GUILayout.MaxWidth(100),GUILayout.MinHeight(40)))
{
Application.OpenURL("https://www.replacedetstore.unity3d.com/en/#!/publisher/5951");
}
EditorGUILayout.EndHorizontal();
if (takeHiResShot)
{
int resWidthN = resWidth*scale;
int resHeightN = resHeight*scale;
RenderTexture rt = new RenderTexture(resWidthN, resHeightN, 24);
myCamera.targetTexture = rt;
TextureFormat tFormat;
if(isTransparent)
tFormat = TextureFormat.ARGB32;
else
tFormat = TextureFormat.RGB24;
Texture2D screenShot = new Texture2D(resWidthN, resHeightN, tFormat,false);
myCamera.Render();
RenderTexture.active = rt;
screenShot.ReadPixels(new Rect(0, 0, resWidthN, resHeightN), 0, 0);
myCamera.targetTexture = null;
RenderTexture.active = null;
byte[] bytes = screenShot.EncodeToPNG();
string filename = ScreenShotName(resWidthN, resHeightN);
System.IO.File.WriteAllBytes(filename, bytes);
Debug.Log(string.Format("Took screenshot to: {0}", filename));
Application.OpenURL(filename);
takeHiResShot = false;
}
EditorGUILayout.HelpBox("In case of any error, make sure you have Unity Pro as the plugin requires Unity Pro to work.",MessageType.Info);
}
19
Source : PanelMain.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
protected internal override void Draw()
{
GUI.DrawTexture(urlRect, patreonIcon);
Vector2 position = Event.current.mousePosition;
if (urlRect.Contains(position))
{
GUI.Label(new Rect(position.x, position.y, 500f, 200f), locale["aottg2Message1"] + "\n" + locale["aottg2Message2"]);
}
if(UnityEngine.GUI.Button(urlRect, string.Empty, GUIStyle.none))
{
Application.OpenURL("https://www.patreon.com/aottg2");
}
enabledPanel = CheckActivePanel();
if (GUI.Button(profileRect, locale["profile"] + " <b>" + User.ProfileName + "</b>"))
{
CheckEnabled(AnarchyManager.ProfilePanel, new GUIBase[] { AnarchyManager.SinglePanel, AnarchyManager.ServerList, AnarchyManager.SettingsPanel });
}
rect.Reset();
if (Button("single"))
{
CheckEnabled(AnarchyManager.SinglePanel, new GUIBase[] { AnarchyManager.ProfilePanel, AnarchyManager.ServerList, AnarchyManager.SettingsPanel });
}
if (Button("multi"))
{
CheckEnabled(AnarchyManager.ServerList, new GUIBase[] { AnarchyManager.ProfilePanel, AnarchyManager.SinglePanel, AnarchyManager.SettingsPanel });
}
if (Button("settings"))
{
CheckEnabled(AnarchyManager.SettingsPanel, new GUIBase[] { AnarchyManager.ProfilePanel, AnarchyManager.ServerList, AnarchyManager.SinglePanel });
}
if (Button("custom_characters"))
{
if (enabledPanel < 0)
{
Application.LoadLevel("characterCreation");
return;
}
}
if(Button("snapshots"))
{
if(enabledPanel < 0)
{
Application.LoadLevel("SnapShot");
return;
}
}
if (Button("exit"))
{
Application.Quit();
}
}
19
Source : OnClickLoadSomething.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void OnClick()
{
OnClickLoadSomething.ResourceTypeOption resourceTypeToLoad = this.ResourceTypeToLoad;
if (resourceTypeToLoad != OnClickLoadSomething.ResourceTypeOption.Scene)
{
if (resourceTypeToLoad == OnClickLoadSomething.ResourceTypeOption.Web)
{
Application.OpenURL(this.ResourceToLoad);
}
}
else
{
Application.LoadLevel(this.ResourceToLoad);
}
}
19
Source : SampleInfo.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void OnGUI()
{
GUILayout.Label("iTween can spin, shake, punch, move, handle audio, fade color and transparency \nand much more with each task needing only one line of code.", new GUILayoutOption[0]);
GUILayout.BeginHorizontal(new GUILayoutOption[0]);
GUILayout.Label("iTween works with C#, JavaScript and Boo. For full doreplacedentation and examples visit:", new GUILayoutOption[0]);
if (GUILayout.Button("http://itween.pixelplacement.com", new GUILayoutOption[0]))
{
Application.OpenURL("http://itween.pixelplacement.com");
}
GUILayout.EndHorizontal();
}
19
Source : AssetDanshariWindow.cs
with MIT License
from akof1314
with MIT License
from akof1314
private void OnContextAbout()
{
Application.OpenURL("https://github.com/akof1314/UnityreplacedetDanshari");
}
19
Source : GUIInterfaceWorld.cs
with MIT License
from BelkinAndrey
with MIT License
from BelkinAndrey
void OnGUI()
{
GUI.skin = skin;
GUI.Box(new Rect(0, 0, Screen.width, 30), "");
if (GUI.Button(new Rect(0, 0, 140, 30), LogoButton))
{
Application.OpenURL("https://github.com/BelkinAndrey/OPENTadpole");
}
GUI.Label(new Rect(150, 5, 170, 30), ">> SimWorldTadpole <<");
if (GUI.Button(new Rect(325, 0, 125, 30), " ConnectomTadpole"))
{
Application.LoadLevel(0);
}
if (GUI.Button(new Rect(Screen.width - 30, 0, 30, 30), CloseButton))
{
Application.Quit();
}
if (GUI.Button(new Rect(Screen.width - 60, 0, 30, 30), FullButton))
{
if (!Screen.fullScreen)
{
W = Screen.width;
H = Screen.height;
Screen.fullScreen = true;
Screen.SetResolution(resolutions[resolutions.Length - 1].width, resolutions[resolutions.Length - 1].height, true);
}
else
{
Screen.fullScreen = false;
Screen.SetResolution(W, H, false);
}
}
GetComponent<LoadBrain>().PathFile = GUI.TextField(new Rect(Screen.width - 260, 5, 180, 20), GetComponent<LoadBrain>().PathFile);
if (GUI.Button(new Rect(Screen.width - 80, 0, 20, 30), DownButton))
{
pilot = !pilot;
}
if (GUI.Button(new Rect(Screen.width - 320, 0, 30, 30), ReStartButton))
{
Application.LoadLevel(1);
}
if (GUI.Button(new Rect(Screen.width - 290, 0, 30, 30), OpenButton))
{
GetComponent<LoadBrain>().Open();
}
if (pilot)
{
Rect RectPilot = new Rect(Screen.width - 260, 35, 200, 200);
OnRect = RectPilot.Contains(Event.current.mousePosition);
GUILayout.BeginArea(RectPilot, GUI.skin.box);
ScrollBlok = GUILayout.BeginScrollView(ScrollBlok, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true));
string[] dir = Directory.GetFiles(Application.dataPath + "/Data/", "*.tad");
foreach (string value in dir)
{
GUILayout.BeginHorizontal();
string v = value.Remove(value.Length - 4).Remove(0, Application.dataPath.Length + 6);
if (GUILayout.Button(v))
{
PlayerPrefs.SetString("Path", v);
Application.LoadLevel(1);
}
GUILayout.EndHorizontal();
}
GUILayout.EndScrollView();
GUILayout.EndArea();
}
}
19
Source : GUIInterface.cs
with MIT License
from BelkinAndrey
with MIT License
from BelkinAndrey
void OnGUI()
{
GUI.skin = skin;
GUI.Box(new Rect(0, 0, Screen.width, 30), "");
if (GUI.Button(new Rect(0, 0, 140, 30), LogoButton))
{
Application.OpenURL("https://github.com/BelkinAndrey/OPENTadpole");
}
GUI.Label(new Rect(150, 5, 170, 30), ">> ConnectomTadpole <<");
if (GUI.Button(new Rect(325, 0, 115, 30), " SimWorldTadpole"))
{
Application.LoadLevel(1);
}
if (GUI.Button(new Rect(Screen.width - 30, 0, 30, 30), CloseButton))
{
Application.Quit();
}
if (GUI.Button(new Rect(Screen.width - 60, 0, 30, 30), FullButton))
{
if (!Screen.fullScreen)
{
W = Screen.width;
H = Screen.height;
Screen.fullScreen = true;
Screen.SetResolution(resolutions[resolutions.Length - 1].width, resolutions[resolutions.Length - 1].height, true);
}
else
{
Screen.fullScreen = false;
Screen.SetResolution(W, H, false);
}
}
GetComponent<SaveOpen>().PathFile = GUI.TextField(new Rect(Screen.width - 260, 5, 180, 20), GetComponent<SaveOpen>().PathFile);
if (GUI.Button(new Rect(Screen.width - 80, 0, 20, 30), DownButton))
{
pilot = !pilot;
}
if (GUI.Button(new Rect(Screen.width - 350, 0, 30, 30), ClearButton))
{
PlayerPrefs.SetString("Path", "");
PlayerPrefs.SetFloat("StartZoom", 3200);
PlayerPrefs.SetFloat("CamX", 0);
PlayerPrefs.SetFloat("CamY", -1840);
PlayerPrefs.SetFloat("CamZ", -100);
Application.LoadLevel(0);
}
if (GUI.Button(new Rect(Screen.width - 320, 0, 30, 30), OpenButton))
{
GetComponent<SaveOpen>().Open();
}
if (GUI.Button(new Rect(Screen.width - 290, 0, 30, 30), SaveButton))
{
GetComponent<SaveOpen>().Save();
}
if (pilot)
{
Rect RectPilot = new Rect(Screen.width - 260, 35, 200, 200);
OnRect = RectPilot.Contains(Event.current.mousePosition);
GUILayout.BeginArea(RectPilot, GUI.skin.box);
ScrollBlok = GUILayout.BeginScrollView(ScrollBlok, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true));
string[] dir = Directory.GetFiles(Application.dataPath + "/Data/", "*.tad");
foreach (string value in dir)
{
GUILayout.BeginHorizontal();
string v = value.Remove(value.Length - 4).Remove(0, Application.dataPath.Length + 6);
if (GUILayout.Button(v))
{
GameObject C = GameObject.Find("Camera");
PlayerPrefs.SetFloat("StartZoom", C.GetComponent<Camera>().orthographicSize);
PlayerPrefs.SetFloat("CamX", C.transform.position.x);
PlayerPrefs.SetFloat("CamY", C.transform.position.y);
PlayerPrefs.SetFloat("CamZ", C.transform.position.z);
PlayerPrefs.SetString("Path", v);
Application.LoadLevel(0);
}
GUILayout.EndHorizontal();
}
GUILayout.EndScrollView();
GUILayout.EndArea();
}
}
19
Source : StartScreen.cs
with MIT License
from BrunoS3D
with MIT License
from BrunoS3D
public void OnGUI()
{
if( !m_infoDownloaded )
{
m_infoDownloaded = true;
// get affiliate links
StartBackgroundTask( StartRequest( PackageRefURL, ( www ) =>
{
var pack = PackageRef.CreateFromJSON( www.downloadHandler.text );
if( pack != null )
{
m_packageRef = pack;
Repaint();
}
} ) );
// get banner information and texture
StartBackgroundTask( StartRequest( BannerInfoURL, ( www ) =>
{
BannerInfo info = BannerInfo.CreateFromJSON( www.downloadHandler.text );
if( info != null && !string.IsNullOrEmpty( info.ImageUrl ) )
{
StartBackgroundTask( StartTextureRequest( info.ImageUrl, ( www2 ) =>
{
Texture2D texture = DownloadHandlerTexture.GetContent( www2 );
if( texture != null )
m_newsImage = texture;
} ) );
}
if( info != null && info.Version >= m_bannerInfo.Version )
{
m_bannerInfo = info;
}
// improve this later
int major = m_bannerInfo.Version / 100;
int minor = ( m_bannerInfo.Version / 10 ) - major * 10;
int release = m_bannerInfo.Version - major * 100 - minor * 10;
m_newVersion = major + "." + minor + "." + release;
Repaint();
} ) );
}
if( m_buttonStyle == null )
{
m_buttonStyle = new GUIStyle( GUI.skin.button );
m_buttonStyle.alignment = TextAnchor.MiddleLeft;
}
if( m_labelStyle == null )
{
m_labelStyle = new GUIStyle( "BoldLabel" );
m_labelStyle.margin = new RectOffset( 4, 4, 4, 4 );
m_labelStyle.padding = new RectOffset( 2, 2, 2, 2 );
m_labelStyle.fontSize = 13;
}
if( m_linkStyle == null )
{
var inv = replacedetDatabase.LoadreplacedetAtPath<Texture2D>( replacedetDatabase.GUIDToreplacedetPath( "1004d06b4b28f5943abdf2313a22790a" ) ); // find a better solution for transparent buttons
m_linkStyle = new GUIStyle();
m_linkStyle.normal.textColor = new Color( 0.2980392f, 0.4901961f, 1f );
m_linkStyle.hover.textColor = Color.white;
m_linkStyle.active.textColor = Color.grey;
m_linkStyle.margin.top = 3;
m_linkStyle.margin.bottom = 2;
m_linkStyle.hover.background = inv;
m_linkStyle.active.background = inv;
}
EditorGUILayout.BeginHorizontal( GUIStyle.none, GUILayout.ExpandWidth( true ) );
{
// left column
EditorGUILayout.BeginVertical( GUILayout.Width( 175 ) );
{
GUILayout.Label( Resourcesreplacedle, m_labelStyle );
if( GUILayout.Button( WikiButton, m_buttonStyle ) )
Application.OpenURL( WikiURL );
GUILayout.Space( 10 );
GUILayout.Label( "Amplify Products", m_labelStyle );
if( m_packageRef.Links != null )
{
var webIcon = EditorGUIUtility.IconContent( "BuildSettings.Web.Small" ).image;
for( int i = 0; i < m_packageRef.Links.Length; i++ )
{
var gc = new GUIContent( " " + m_packageRef.Links[ i ].replacedle, webIcon );
if( GUILayout.Button( gc, m_buttonStyle ) )
Application.OpenURL( m_packageRef.Links[ i ].Url + RefID );
}
}
GUILayout.Label( "* Affiliate Links", "minilabel" );
}
EditorGUILayout.EndVertical();
// right column
EditorGUILayout.BeginVertical( GUILayout.Width( 650 - 175 - 9 ), GUILayout.ExpandHeight( true ) );
{
GUILayout.Label( Communityreplacedle, m_labelStyle );
EditorGUILayout.BeginHorizontal( GUILayout.ExpandWidth( true ) );
{
if( GUILayout.Button( DiscordButton, GUILayout.ExpandWidth( true ) ) )
{
Application.OpenURL( DiscordURL );
}
if( GUILayout.Button( ForumButton, GUILayout.ExpandWidth( true ) ) )
{
Application.OpenURL( ForumURL );
}
}
EditorGUILayout.EndHorizontal();
GUILayout.Label( Updatereplacedle, m_labelStyle );
if( m_newsImage != null )
{
var gc = new GUIContent( m_newsImage );
int width = 650 - 175 - 9 - 8;
width = Mathf.Min( m_newsImage.width, width );
int height = m_newsImage.height;
height = (int)( ( width + 8 ) * ( (float)m_newsImage.height / (float)m_newsImage.width ) );
Rect buttonRect = EditorGUILayout.GetControlRect( false, height );
EditorGUIUtility.AddCursorRect( buttonRect, MouseCursor.Link );
if( GUI.Button( buttonRect, gc, m_linkStyle ) )
{
Application.OpenURL( m_bannerInfo.LinkUrl );
}
}
m_scrollPosition = GUILayout.BeginScrollView( m_scrollPosition, GUILayout.ExpandHeight( true ), GUILayout.ExpandWidth( true ) );
GUILayout.Label( m_bannerInfo.NewsText, "WordWrappedMiniLabel", GUILayout.ExpandHeight( true ) );
GUILayout.EndScrollView();
EditorGUILayout.BeginHorizontal( GUILayout.ExpandWidth( true ) );
{
EditorGUILayout.BeginVertical();
GUILayout.Label( replacedleSTR, m_labelStyle );
GUILayout.Label( "Installed Version: " + VersionInfo.StaticToString() );
if( m_bannerInfo.Version > VersionInfo.FullNumber )
{
var cache = GUI.color;
GUI.color = Color.red;
GUILayout.Label( "New version available: " + m_newVersion, "BoldLabel" );
GUI.color = cache;
}
else
{
var cache = GUI.color;
GUI.color = Color.green;
GUILayout.Label( "You are using the latest version", "BoldLabel" );
GUI.color = cache;
}
EditorGUILayout.BeginHorizontal();
GUILayout.Label( "Download links:" );
if( GUILayout.Button( "Amplify", m_linkStyle ) )
Application.OpenURL( SiteURL );
GUILayout.Label( "-" );
if( GUILayout.Button( "replacedet Store", m_linkStyle ) )
Application.OpenURL( StoreURL );
EditorGUILayout.EndHorizontal();
GUILayout.Space( 7 );
EditorGUILayout.EndVertical();
GUILayout.FlexibleSpace();
EditorGUILayout.BeginVertical();
GUILayout.Space( 7 );
GUILayout.Label( Icon );
EditorGUILayout.EndVertical();
}
EditorGUILayout.EndHorizontal();
}
EditorGUILayout.EndVertical();
}
EditorGUILayout.EndHorizontal();
EditorGUILayout.BeginHorizontal( "ProjectBrowserBottomBarBg", GUILayout.ExpandWidth( true ), GUILayout.Height( 22 ) );
{
GUILayout.FlexibleSpace();
EditorGUI.BeginChangeCheck();
var cache = EditorGUIUtility.labelWidth;
EditorGUIUtility.labelWidth = 100;
m_startup = EditorGUILayout.ToggleLeft( "Show At Startup", m_startup, GUILayout.Width( 120 ) );
EditorGUIUtility.labelWidth = cache;
if( EditorGUI.EndChangeCheck() )
{
EditorPrefs.SetBool( Preferences.PrefStartUp, m_startup );
}
}
EditorGUILayout.EndHorizontal();
// Find a better way to update link buttons without repainting the window
Repaint();
}
19
Source : About.cs
with MIT License
from BrunoS3D
with MIT License
from BrunoS3D
public void OnGUI()
{
m_scrollPosition = GUILayout.BeginScrollView( m_scrollPosition );
GUILayout.BeginVertical();
GUILayout.Space( 10 );
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
GUILayout.Box( m_aboutImage, GUIStyle.none );
if( Event.current.type == EventType.MouseUp &&
GUILayoutUtility.GetLastRect().Contains( Event.current.mousePosition ) )
{
Application.OpenURL( "http://www.amplify.pt" );
}
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
GUIStyle labelStyle = new GUIStyle( EditorStyles.label );
labelStyle.alignment = TextAnchor.MiddleCenter;
labelStyle.wordWrap = true;
GUILayout.Label( "\nAmplify Occlusion " + VersionInfo.StaticToString(), labelStyle, GUILayout.ExpandWidth( true ) );
GUILayout.Label( "\nCopyright (c) Amplify Creations, Lda. All rights reserved.\n", labelStyle, GUILayout.ExpandWidth( true ) );
GUILayout.EndVertical();
GUILayout.EndScrollView();
}
19
Source : LeanOpenUrl.cs
with GNU General Public License v3.0
from Cytoid
with GNU General Public License v3.0
from Cytoid
public void Open(string url)
{
Application.OpenURL(url);
}
19
Source : LunarConsoleEditor.cs
with GNU General Public License v3.0
from Cytoid
with GNU General Public License v3.0
from Cytoid
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
if (LunarConsoleConfig.freeVersion)
{
if (m_buttonStyle == null)
{
m_buttonStyle = new GUIStyle("LargeButton");
}
if (GUILayout.Button("Get PRO version", m_buttonStyle))
{
Application.OpenURL("https://goo.gl/jvJzr7");
}
}
}
19
Source : MenuItems.cs
with GNU General Public License v3.0
from Cytoid
with GNU General Public License v3.0
from Cytoid
[MenuItem("Window/Lunar Mobile Console/Report bug...")]
static void RequestFeature()
{
Application.OpenURL("https://github.com/SpaceMadness/lunar-unity-console/issues/new");
}
19
Source : Updater.cs
with GNU General Public License v3.0
from Cytoid
with GNU General Public License v3.0
from Cytoid
public static void CheckForUpdates(bool silent = true)
{
LunarConsoleHttpClient downloader = new LunarConsoleHttpClient(LunarConsoleConfig.fullVersion ? Constants.UpdateJsonURLFull : Constants.UpdateJsonURLFree);
downloader.DownloadString(delegate (string response, Exception error)
{
if (error != null)
{
Log.e(error, "Can't get updater info");
if (!silent)
{
Utils.ShowDialog(kMessageBoxreplacedle, "Update info is not available.\n\nTry again later.", "OK");
}
return;
}
UpdateInfo info;
if (response != null && TryParseUpdateInfo(response, out info))
{
if (IsShouldSkipVersion(info.version))
{
Log.d("User decided to skip version {0}", info.version);
return;
}
if (PluginVersionChecker.IsNewerVersion(info.version))
{
StringBuilder message = new StringBuilder();
message.AppendFormat("A new version {0} is available!\n\n", info.version);
if (info.message != null && info.message.Length > 0)
{
message.Append(info.message);
message.AppendLine();
}
Utils.ShowDialog(kMessageBoxreplacedle, message.ToString(),
new DialogButton("Details...", delegate (string obj)
{
Application.OpenURL(info.url);
LunarConsoleEditorreplacedytics.TrackEvent("Version", "updater_details");
}),
new DialogButton("Remind me later", delegate (string obj)
{
LunarConsoleEditorreplacedytics.TrackEvent("Version", "updater_later");
}),
new DialogButton("Skip this version", delegate (string obj)
{
SetShouldSkipVersion(info.version);
LunarConsoleEditorreplacedytics.TrackEvent("Version", "updater_skip");
})
);
}
else
{
if (!silent)
{
Utils.ShowMessageDialog(kMessageBoxreplacedle, "Everything is up to date");
}
Debug.Log("Everything is up to date");
}
}
else
{
Log.e("Unable to parse response: '{0}'", response);
if (!silent)
{
Utils.ShowDialog(kMessageBoxreplacedle, "Update info is not available.\n\nTry again later.", "OK");
}
}
});
}
19
Source : LocalizationEditor.cs
with GNU General Public License v3.0
from Cytoid
with GNU General Public License v3.0
from Cytoid
private static void DisplayDocsAndSheetId(string replacedle, bool disableId, bool disableOpen, Localizationreplacedet sheet, SerializedProperty doreplacedent, string defaultDocs, string defaultSheet, string defaultTextreplacedetPath, Action download)
{
EditorGUILayout.BeginVertical("Box");
EditorGUILayout.LabelField(replacedle, (GUIStyle)"IN replacedleText");
EditorGUI.BeginDisabledGroup(disableId);
var docsIdProp = doreplacedent.FindPropertyRelative("docsId");
if (string.IsNullOrEmpty(docsIdProp.stringValue))
{
docsIdProp.stringValue = defaultDocs;
}
EditorGUILayout.PropertyField(docsIdProp);
var sheetIdProps = doreplacedent.FindPropertyRelative("sheetId");
if (string.IsNullOrEmpty(sheetIdProps.stringValue))
{
sheetIdProps.stringValue = defaultSheet;
}
EditorGUILayout.PropertyField(sheetIdProps);
var textreplacedetProps = doreplacedent.FindPropertyRelative("textreplacedet");
if (textreplacedetProps.objectReferenceValue == null && !string.IsNullOrEmpty(defaultTextreplacedetPath))
{
textreplacedetProps.objectReferenceValue = replacedetDatabase.LoadreplacedetAtPath<Textreplacedet>(defaultTextreplacedetPath);
}
EditorGUILayout.PropertyField(textreplacedetProps);
EditorGUI.EndDisabledGroup();
EditorGUI.BeginDisabledGroup(disableOpen);
var downloadOnstartProps = doreplacedent.FindPropertyRelative("downloadOnStart");
EditorGUILayout.PropertyField(downloadOnstartProps);
var formatProps = doreplacedent.FindPropertyRelative("format");
EditorGUILayout.PropertyField(formatProps);
EditorGUILayout.BeginHorizontal();
EditorGUILayout.PrefixLabel(string.Empty);
if(GUILayout.Button("Open"))
{
var url = string.Format("https://docs.google.com/spreadsheets/d/{0}/edit#gid={1}", docsIdProp.stringValue, sheetIdProps.stringValue);
Application.OpenURL(url);
}
if(GUILayout.Button("Download"))
{
download();
}
EditorGUILayout.EndHorizontal();
EditorGUI.EndDisabledGroup();
EditorGUILayout.EndVertical();
}
19
Source : QuickActions.cs
with GNU General Public License v3.0
from Cytoid
with GNU General Public License v3.0
from Cytoid
[Button(Name = "Rate on TapTap")]
[DisableInEditorMode]
public void RateOnTapTap()
{
Context.AudioManager.Get("ActionSuccess").Play();
Dialog.Prompt("享受 Cytoid 吗?\n请在 TapTap 上给我们打个分吧!", () =>
{
Application.OpenURL("https://www.taptap.com/app/158749");
});
}
19
Source : Avatar.cs
with GNU General Public License v3.0
from Cytoid
with GNU General Public License v3.0
from Cytoid
protected void Awake()
{
avatarSpinner.bypreplacedOnClickHitboxCheck = false;
avatarSpinner.onPointerClick.AddListener(_ =>
{
Context.Haptic(HapticTypes.SoftImpact, true);
Context.AudioManager.Get("Navigate1").Play(ignoreDsp: true);
switch (action)
{
case AvatarAction.OpenProfile:
if (Context.IsOffline())
{
Dialog.PromptAlert("DIALOG_OFFLINE_FEATURE_NOT_AVAILABLE".Get());
}
else
{
Context.ScreenManager.ChangeScreen(ProfileScreen.Id, ScreenTransition.In,
payload: new ProfileScreen.Payload {Id = owner.Id});
}
break;
case AvatarAction.OpenExternalProfile:
Application.OpenURL($"{Context.WebsiteUrl}/profile/{owner.Uid}");
break;
case AvatarAction.ViewLevels:
var screen = Context.ScreenManager.GetScreen<CommunityLevelSelectionScreen>();
var payload =
new CommunityLevelSelectionScreen.Payload
{
Query = new OnlineLevelQuery
{
sort = "creation_date",
order = "desc",
category = "all",
owner = owner.Uid
}
};
if (screen.State != ScreenState.Active)
{
Context.ScreenManager.ChangeScreen(CommunityLevelSelectionScreen.Id, ScreenTransition.In,
payload: payload);
}
else
{
// In-place modification
screen.LoadedPayload.Query = payload.Query;
screen.LoadedPayload.Levels = new List<OnlineLevel>();
screen.LoadedPayload.LastPage = 0;
screen.LoadedPayload.IsLastPageLoaded = false;
screen.LoadedPayload.CanLoadMore = true;
screen.LoadedPayload.ScrollPosition = 0;
screen.LoadLevels(true);
}
break;
}
});
}
19
Source : RankingsTab.cs
with GNU General Public License v3.0
from Cytoid
with GNU General Public License v3.0
from Cytoid
public IPromise<(int, List<RankingEntry>)> UpdateRankings(string levelId, string chartType)
{
viewMoreButton.gameObject.SetActive(false);
rankingText.text = "";
spinner.IsSpinning = true;
rankingContainer.Clear();
rankingContainerStatusText.text = "GAME_PREP_RANKINGS_DOWNLOADING".Get();
var token = updateRankingToken = DateTime.Now;
return Context.OnlinePlayer.GetLevelRankings(levelId, chartType)
.Then(ret =>
{
if (token != updateRankingToken) return (-1, null);
var (rank, entries) = ret;
SetRanking(rank);
rankingContainer.SetData(entries);
rankingContainerStatusText.text = "";
if (entries.Count == 0)
{
rankingContainerStatusText.text = "GAME_PREP_RANKINGS_BE_THE_FIRST".Get();
}
if (entries.Count > 0)
{
viewMoreButton.gameObject.SetActive(true);
}
viewMoreButton.onPointerClick.SetListener(_ =>
{
Application.OpenURL(
$"{Context.WebsiteUrl}/levels/{levelId}"); // TODO: Jump to selected difficulty?
});
return ret;
})
.CatchRequestError(error =>
{
if (token != updateRankingToken) return (-1, null);
if (error.IsHttpError) {
if (error.StatusCode != 404)
{
throw error;
}
}
rankingText.text = "N/A";
rankingContainerStatusText.text = "GAME_PREP_RANKINGS_COULD_NOT_DOWNLOAD".Get();
return (-1, null);
})
.Finally(() =>
{
if (token != updateRankingToken) return;
spinner.IsSpinning = false;
});
}
19
Source : CharacterSelectionScreen.cs
with GNU General Public License v3.0
from Cytoid
with GNU General Public License v3.0
from Cytoid
public async void Reload()
{
var mergedMeta = LoadedPayload.OwnedCharacters[LoadedPayload.SelectedIndex];
var meta = mergedMeta.variants[LoadedPayload.SelectedVariantIndex];
ParallaxHolder.WillDelaySet = true;
var characterBundle = await Context.BundleManager.LoadCachedBundle(Characterreplacedet.GetMainBundleId(meta.replacedetId));
var loader = characterBundle.LoadreplacedetAsync<GameObject>("Character");
await loader;
var characterreplacedet = Instantiate((GameObject) loader.replacedet).GetComponent<Characterreplacedet>();
var requireReload = IntentPayload.displayedCharacter == null
|| IntentPayload.displayedCharacter.SetId != meta.SetId
|| IntentPayload.displayedCharacter.VariantParallaxreplacedet != meta.VariantParallaxreplacedet
|| IntentPayload.displayedCharacter.VariantAudioreplacedet != meta.VariantAudioreplacedet;
Debug.Log("Require reload: " + requireReload);
Debug.Log(IntentPayload.displayedCharacter?.SetId);
Debug.Log(meta.SetId);
Debug.Log(IntentPayload.displayedCharacter?.VariantParallaxreplacedet);
Debug.Log(meta.VariantParallaxreplacedet);
Debug.Log(IntentPayload.displayedCharacter?.VariantAudioreplacedet);
Debug.Log(meta.VariantAudioreplacedet);
if (requireReload)
{
infoCard.Leave(false);
SpinnerOverlay.Show();
}
await UniTask.WaitUntil(() => !characterTransitionElement.IsInTransition);
characterTransitionElement.Leave();
if (meta.Owned)
{
lockedOverlayCanvasGroup.blocksRaycasts = false;
lockedOverlayCanvasGroup.DOFade(0, 0.4f);
await Context.CharacterManager.SetActiveCharacter(meta.replacedetId, requireReload);
if (requireReload)
{
await UniTask.Delay(TimeSpan.FromSeconds(0.4f));
}
}
else
{
lockedOverlayCanvasGroup.blocksRaycasts = true;
lockedOverlayCanvasGroup.DOFade(1, 0.4f);
unlockButton.onPointerClick.SetListener(_ =>
{
if (meta.QuestId == null)
{
Dialog.PromptAlert("This is a bug. Blame Neo for that.\nJoin our Discord to report this bug: https://discord.gg/cytoid");
return;
}
SpinnerOverlay.Show();
RestClient.Get<SingleQuestState>(new RequestHelper
{
Uri = $"{Context.ApiUrl}/epics/adventures/characters/{meta.QuestId}",
Headers = Context.OnlinePlayer.GetRequestHeaders(),
EnableDebug = true
})
.Then(data =>
{
QuestOverlay.Show(new AdventureState {OngoingQuests = new List<OngoingQuest>{data.Quest}});
})
.Catch(err =>
{
Debug.LogError(err);
Dialog.PromptAlert("DIALOG_COULD_NOT_CONNECT_TO_SERVER".Get());
})
.Finally(() => SpinnerOverlay.Hide());
});
}
nameText.text = meta.Name;
nameGradient.SetGradient(characterreplacedet.nameGradient.GetGradient());
descriptionText.text = meta.Description;
illustratorText.text = meta.Illustrator.Name;
illustratorProfileButton.onPointerClick.SetListener(_ => Application.OpenURL(meta.Illustrator.Url));
if (meta.CharacterDesigner != null && !meta.CharacterDesigner.Name.IsNullOrEmptyTrimmed())
{
characterDesignerHolder.gameObject.SetActive(true);
characterDesignerText.text = meta.CharacterDesigner.Name;
characterDesignerProfileButton.onPointerClick.SetListener(_ =>
Application.OpenURL(meta.CharacterDesigner.Url));
}
else
{
characterDesignerHolder.gameObject.SetActive(false);
}
if (meta.Exp == null)
{
meta.Exp = new CharacterMeta.ExpData
{
CurrentLevel = 1,
CurrentLevelExp = 0,
NextLevelExp = 10,
TotalExp = 0
};
}
levelText.text = $"{"PROFILE_WIDGET_LEVEL".Get()} {meta.Exp.CurrentLevel}";
expText.text = $"{"PROFILE_WIDGET_EXP".Get()} {(int) meta.Exp.TotalExp}/{(int) meta.Exp.NextLevelExp}";
if (meta.Level != null)
{
levelCard.SetModel(meta.Level.ToLevel(LevelType.User), ignoreIfIdEqual: true);
}
LayoutFixer.Fix(infoCard.transform);
if (requireReload)
{
if (characterreplacedet.musicAudio == null)
{
muteButtonImage.sprite = volumeSprite;
muteButtonImage.SetAlpha(0.3f);
muteButton.scaleOnClick = false;
muteButton.onPointerClick.RemoveAllListeners();
}
else
{
muteButtonImage.sprite = Context.Player.Settings.PlayCharacterTheme ? volumeSprite : volumeMuteSprite;
muteButtonImage.SetAlpha(1f);
muteButton.scaleOnClick = true;
muteButton.onPointerClick.SetListener(_ =>
{
Context.Player.Settings.PlayCharacterTheme = !Context.Player.Settings.PlayCharacterTheme;
Context.Player.SaveSettings();
LoopAudioPlayer.Instance.SetMainAudio(Context.Player.Settings.PlayCharacterTheme
? characterreplacedet.musicAudio
: LoopAudioPlayer.Instance.defaultLoopAudio);
muteButtonImage.sprite = Context.Player.Settings.PlayCharacterTheme ? volumeSprite : volumeMuteSprite;
});
}
NavigationBackdrop.Instance.UpdateBlur();
}
infoCard.Enter();
// Spawn radio group
foreach (Transform child in variantSelectorHolder)
{
Destroy(child.gameObject);
}
if (mergedMeta.HasOtherVariants)
{
var radioGroup = Instantiate(NavigationUiElementProvider.Instance.pillRadioGroup, variantSelectorHolder);
radioGroup.labels = mergedMeta.variants.Select(it => it.VariantName).ToList();
radioGroup.values = Enumerable.Range(0, mergedMeta.variants.Count).Select(it => it.ToString()).ToList();
radioGroup.defaultValue = mergedMeta.variants.FindIndex(it => it.Id == meta.Id).ToString();
radioGroup.Initialize();
radioGroup.onSelect.AddListener(it =>
{
LoadedPayload.SelectedVariantIndex = int.Parse(it);
Reload();
});
variantSelectorHolder.RebuildLayout();
}
await UniTask.WaitUntil(() => !characterTransitionElement.IsInTransition);
await characterDisplay.Load(Characterreplacedet.GetTachieBundleId(meta.replacedetId), !meta.Owned);
characterTransitionElement.Enter();
characterTransitionElement.Apply(it =>
{
it.enterMultiplier = 0.4f;
it.enterDelay = 0.4f;
it.enterDuration = 0.8f;
});
if (requireReload)
{
Destroy(characterreplacedet.gameObject);
Context.BundleManager.Release(Characterreplacedet.GetMainBundleId(meta.replacedetId));
}
if (Context.IsOffline())
{
SpinnerOverlay.Hide();
}
else
{
if (meta.Owned)
{
RestClient.Post(new RequestHelper
{
Uri = $"{Context.ApiUrl}/profile/{Context.Player.Id}/character",
Headers = Context.OnlinePlayer.GetRequestHeaders(),
EnableDebug = true,
Body = new CharacterPostData
{
characterId = meta.Id
}
})
.CatchRequestError(error =>
{
Debug.LogError(error);
Toast.Next(Toast.Status.Failure, "TOAST_FAILED_TO_UPDATE_PROFILE_CHARACTER".Get());
})
.Finally(() => { SpinnerOverlay.Hide(); });
}
}
ParallaxHolder.WillDelaySet = false;
IntentPayload.displayedCharacter = meta;
}
19
Source : CollectionViewOnIOButton.cs
with GNU General Public License v3.0
from Cytoid
with GNU General Public License v3.0
from Cytoid
protected void Awake()
{
onPointerClick.AddListener(_ => Application.OpenURL($"{Context.WebsiteUrl}/collections/{this.GetScreenParent<CollectionDetailsScreen>().LoadedPayload.Collection.uid}"));
}
19
Source : LevelArtistSourceButton.cs
with GNU General Public License v3.0
from Cytoid
with GNU General Public License v3.0
from Cytoid
protected void Awake()
{
onPointerClick.AddListener(_ => Application.OpenURL(Context.SelectedLevel.Meta.artist_source));
}
19
Source : MainMenuScreen.cs
with GNU General Public License v3.0
from Cytoid
with GNU General Public License v3.0
from Cytoid
public override async void OnScreenBecameActive()
{
base.OnScreenBecameActive();
//WebViewOverlay.Show();
if (StartupLogger.Instance != null)
{
StartupLogger.Instance.Dispose();
}
upperLeftOverlayImage.SetAlpha(Context.CharacterManager.GetActiveCharacterreplacedet().mainMenuUpperLeftOverlayAlpha);
overlayImage.SetAlpha(Context.CharacterManager.GetActiveCharacterreplacedet().mainMenuRightOverlayAlpha);
var levelCount = Context.LevelManager.LoadedLocalLevels.Count(it =>
(it.Value.Type == LevelType.User || it.Value.Type == LevelType.BuiltIn) && !BuiltInData.TrainingModeLevelIds.Contains(it.Value.Id));
freePlayText.text = "MAIN_LEVELS_LOADED".Get(levelCount);
freePlayText.transform.RebuildLayout();
ProfileWidget.Instance.Enter();
if (Context.CharacterManager.GetActiveCharacterreplacedet().mirrorLayout)
{
layout.anchorMin = new Vector2(0, 0.5f);
layout.anchorMax = new Vector2(0, 0.5f);
layout.pivot = new Vector2(0, 0.5f);
layout.ancreplaceddPosition = new Vector2(96, -90);
overlayHolder.SetLeft(280);
overlayHolder.SetRight(840);
overlayHolder.SetLocalScaleX(-2);
}
else
{
layout.anchorMin = new Vector2(1, 0.5f);
layout.anchorMax = new Vector2(1, 0.5f);
layout.pivot = new Vector2(1, 0.5f);
layout.ancreplaceddPosition = new Vector2(-96, -90);
overlayHolder.SetLeft(840);
overlayHolder.SetRight(280);
overlayHolder.SetLocalScaleX(2);
}
// Check new events
if (Context.IsOnline() && Context.OnlinePlayer.IsAuthenticated)
{
RestClient.GetArray<EventMeta>(new RequestHelper
{
Uri = $"{Context.ApiUrl}/events",
Headers = Context.OnlinePlayer.GetRequestHeaders(),
EnableDebug = true
}).AbortOnScreenBecameInactive(this).Then(events =>
{
var hasUnseenEvent = false;
foreach (var meta in events)
{
if (Context.Player.Settings.SeenEvents.Contains(meta.uid))
{
continue;
}
hasUnseenEvent = true;
}
if (hasUnseenEvent)
{
eventNotification.Show();
}
}).CatchRequestError(Debug.LogWarning);
}
if (Context.InitializationState.IsAfterFirstLaunch() && !LaunchedFirstLaunchDialogue)
{
LaunchedFirstLaunchDialogue = true;
var text = Resources.Load<Textreplacedet>("Stories/Intro");
LevelSelectionScreen.HighlightedLevelId = BuiltInData.TutorialLevelId;
var story = new Story(text.text);
Resources.Unloadreplacedet(text);
story.variablesState["IsBeginner"] = levelCount < 10;
await DialogueOverlay.Show(story);
LevelSelectionScreen.HighlightedLevelId = null;
Context.Player.ShouldOneShot("Android Migration Info");
}
else
{
if (DialogueOverlay.IsShown())
{
await UniTask.WaitUntil(() => !DialogueOverlay.IsShown());
}
if (Context.AndroidVersionCode >= 30 || Application.isEditor)
{
if (Context.Player.ShouldOneShot("Android Migration Info"))
{
await AndroidMigrationInfoOverlay.Show();
}
}
if (PromptCachedCharacterDataCleared)
{
PromptCachedCharacterDataCleared = false;
Dialog.PromptAlert("DIALOG_CACHED_CHARACTER_DATA_CLEARED".Get());
}
// Check announcement
if (!CheckedAnnouncement && Context.IsOnline())
{
RestClient.Get<Announcement>(new RequestHelper
{
Uri = $"{Context.ApiUrl}/announcements",
Headers = Context.OnlinePlayer.GetRequestHeaders(),
EnableDebug = true
}).Then(it =>
{
CheckedAnnouncement = true;
if (it.message != null)
{
Dialog.PromptAlert(it.message);
}
print($"local: {Application.version}, latest: {it.currentVersion}, min supported: {it.minSupportedVersion}");
var localVersion = new Version(Application.version);
var currentVersion = new Version(it.currentVersion);
var minSupportedVersion = new Version(it.minSupportedVersion);
if (localVersion < minSupportedVersion)
{
Dialog.PromptUnclosable("DIALOG_UPDATE_REQUIRED".Get(),
() => Application.OpenURL(Context.StoreUrl));
return;
}
if (localVersion < currentVersion)
{
Dialog.Prompt("DIALOG_UPDATE_AVAILABLE_X_Y".Get(currentVersion, localVersion),
() => Application.OpenURL(Context.StoreUrl));
}
}).CatchRequestError(Debug.LogError);
}
}
}
19
Source : LevelCoverArtistSourceButton.cs
with GNU General Public License v3.0
from Cytoid
with GNU General Public License v3.0
from Cytoid
protected void Awake()
{
onPointerClick.AddListener(_ => Application.OpenURL(Context.SelectedLevel.Meta.illustrator_source));
}
19
Source : LevelViewOnCytoidIOButton.cs
with GNU General Public License v3.0
from Cytoid
with GNU General Public License v3.0
from Cytoid
protected void Awake()
{
onPointerClick.AddListener(_ => Application.OpenURL($"{Context.WebsiteUrl}/levels/{Context.SelectedLevel.Id}"));
}
19
Source : WebViewHolder.cs
with GNU General Public License v3.0
from Cytoid
with GNU General Public License v3.0
from Cytoid
protected override void Awake()
{
base.Awake();
if (GameObject.FindGameObjectsWithTag("WebView").Length > 1)
{
Destroy(gameObject);
return;
}
DontDestroyOnLoad(gameObject);
webView.Init(
cb: (msg) =>
{
Debug.Log(string.Format("CallFromJS[{0}]", msg));
},
err: (msg) =>
{
Debug.Log(string.Format("CallOnError[{0}]", msg));
},
started: (msg) =>
{
Debug.Log(string.Format("CallOnStarted[{0}]", msg));
},
hooked: (msg) =>
{
Debug.Log(string.Format("CallOnHooked[{0}]", msg));
try
{
var uri = new Uri(msg);
Application.OpenURL(msg);
}
catch
{
// Ignored
}
},
ld: (msg) =>
{
Debug.Log(string.Format("CallOnLoaded[{0}]", msg));
#if UNITY_EDITOR_OSX || !UNITY_ANDROID
webView.EvaluateJS(@"
if (window && window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.unityControl) {
window.Unity = {
call: function(msg) {
window.webkit.messageHandlers.unityControl.postMessage(msg);
}
}
} else {
window.Unity = {
call: function(msg) {
window.location = 'unity:' + msg;
}
}
}
");
#endif
webView.EvaluateJS(@"doreplacedent.body.style.background = 'none';");
OnWebViewLoaded.Invoke(msg);
},
//ua: "custom user agent string",
enableWKWebView: true,
transparent: true
);
webView.SetMargins(0, 0, (int) ((48 + 96 + 48) / 1920f * UnityEngine.Screen.width), 0);
webView.SetScrollBounceEnabled(true);
}
19
Source : EventSelectionScreen.cs
with GNU General Public License v3.0
from Cytoid
with GNU General Public License v3.0
from Cytoid
public void LoadEvent(EventMeta meta)
{
async UniTask LoadCover(CancellationToken token)
{
replacedert.IsNotNull(meta.cover);
var tasks = new List<UniTask>();
if (coverImage.sprite != null)
{
coverImage.DOKill();
coverImage.DOColor(Color.black, 0.4f);
tasks.Add(UniTask.Delay(TimeSpan.FromSeconds(0.4f), cancellationToken: token));
}
Sprite sprite = null;
tasks.Add(Context.replacedetMemory.Loadreplacedet<Sprite>(meta.cover.OriginalUrl, replacedetTag.EventCover, cancellationToken: token).ContinueWith(result => sprite = result));
try
{
await tasks;
}
catch (OperationCanceledException)
{
return;
}
coverImage.sprite = sprite;
coverImage.FitSpriteAspectRatio();
coverImage.DOColor(Color.white, 2f).SetDelay(0.8f);
}
async UniTask LoadLogo(CancellationToken token)
{
replacedert.IsNotNull(meta.logo);
var tasks = new List<UniTask>();
if (logoImage.sprite != null)
{
logoImage.DOKill();
logoImage.DOFade(0, 0.4f);
tasks.Add(UniTask.Delay(TimeSpan.FromSeconds(0.4f), cancellationToken: token));
}
Sprite sprite = null;
tasks.Add(Context.replacedetMemory.Loadreplacedet<Sprite>(meta.logo.OriginalUrl, replacedetTag.EventLogo, cancellationToken: token).ContinueWith(result => sprite = result));
try
{
await tasks;
}
catch (OperationCanceledException)
{
return;
}
logoImage.sprite = sprite;
logoImage.DOFade(1, 0.8f).SetDelay(0.4f);
}
AddTask(LoadCover);
AddTask(LoadLogo);
Context.Player.Settings.SeenEvents.Add(meta.uid);
Context.Player.SaveSettings();
infoBanner.Leave(onComplete: () =>
{
if (!Context.Player.Settings.ReadEventDetails.Contains(meta.uid))
{
viewDetailsNotification.Show();
}
if (!Context.Player.Settings.ReadEventObjectives.Contains(meta.uid))
{
viewObjectivesNotification.Show();
}
viewDetailsButton.onPointerClick.SetListener(_ =>
{
Context.Player.Settings.ReadEventDetails.Add(meta.uid);
Context.Player.SaveSettings();
viewDetailsNotification.Hide();
if (meta.url.IsNullOrEmptyTrimmed())
{
Application.OpenURL($"{Context.WebsiteUrl}/posts/{meta.uid}");
}
else
{
WebViewOverlay.Show(meta.url,
onFullyShown: () =>
{
LoopAudioPlayer.Instance.FadeOutLoopPlayer();
},
onFullyHidden: async () =>
{
AudioSettings.Reset(AudioSettings.GetConfiguration());
Context.AudioManager.Dispose();
Context.AudioManager.Initialize();
await UniTask.DelayFrame(5);
LoopAudioPlayer.Instance.Apply(it =>
{
it.FadeInLoopPlayer();
it.PlayAudio(it.PlayingAudio, forceReplay: true);
});
});
}
});
const string dateFormat = "yyyy/MM/dd HH:mm";
durationText.text = (meta.startDate.HasValue ? meta.startDate.Value.LocalDateTime.ToString(dateFormat) : "")
+ "~"
+ (meta.endDate.HasValue ? meta.endDate.Value.LocalDateTime.ToString(dateFormat) : "");
viewObjectivesButton.onPointerClick.SetListener(_ =>
{
Context.Player.Settings.ReadEventObjectives.Add(meta.uid);
Context.Player.SaveSettings();
viewObjectivesNotification.Hide();
SpinnerOverlay.Show();
RestClient.Get<AdventureState>(new RequestHelper
{
Uri = $"{Context.ApiUrl}/epics/adventures/{meta.epicId}",
Headers = Context.OnlinePlayer.GetRequestHeaders(),
EnableDebug = true
})
.Then(QuestOverlay.Show)
.Catch(err =>
{
Debug.LogError(err);
Dialog.PromptAlert("DIALOG_COULD_NOT_CONNECT_TO_SERVER".Get());
})
.Finally(() => SpinnerOverlay.Hide());
});
enterButton.onPointerClick.SetListener(_ =>
{
if (meta.locked)
{
Context.Haptic(HapticTypes.Failure, true);
// TODO
return;
}
Context.Haptic(HapticTypes.SoftImpact, true);
if (meta.levelId != null)
{
SpinnerOverlay.Show();
RestClient.Get<OnlineLevel>(new RequestHelper
{
Uri = $"{Context.ApiUrl}/levels/{meta.levelId}"
}).Then(level =>
{
Context.ScreenManager.ChangeScreen(
GamePreparationScreen.Id, ScreenTransition.In, 0.4f,
transitionFocus: GetComponent<RectTransform>().GetScreenSpaceCenter(),
payload: new GamePreparationScreen.Payload {Level = level.ToLevel(LevelType.User)}
);
}).CatchRequestError(error =>
{
Debug.LogError(error);
Dialog.PromptAlert("DIALOG_COULD_NOT_CONNECT_TO_SERVER".Get());
}).Finally(() => SpinnerOverlay.Hide());
}
else if (meta.collectionId != null)
{
Context.ScreenManager.ChangeScreen(
CollectionDetailsScreen.Id, ScreenTransition.In, 0.4f,
transitionFocus: GetComponent<RectTransform>().GetScreenSpaceCenter(),
payload: new CollectionDetailsScreen.Payload
{CollectionId = meta.collectionId, Type = LevelType.User}
);
}
});
infoBanner.transform.RebuildLayout();
infoBanner.Enter();
});
}
19
Source : SteamVR_Update.cs
with MIT License
from dag10
with MIT License
from dag10
public void OnGUI()
{
EditorGUILayout.HelpBox("A new version of the SteamVR plugin is available!", MessageType.Warning);
var resourcePath = GetResourcePath();
var logo = replacedetDatabase.LoadreplacedetAtPath<Texture2D>(resourcePath + "logo.png");
var rect = GUILayoutUtility.GetRect(position.width, 150, GUI.skin.box);
if (logo)
GUI.DrawTexture(rect, logo, ScaleMode.ScaleToFit);
scrollPosition = GUILayout.BeginScrollView(scrollPosition);
GUILayout.Label("Current version: " + currentVersion);
GUILayout.Label("New version: " + version);
if (notes != "")
{
GUILayout.Label("Release notes:");
EditorGUILayout.HelpBox(notes, MessageType.Info);
}
GUILayout.EndScrollView();
GUILayout.FlexibleSpace();
if (GUILayout.Button("Get Latest Version"))
{
Application.OpenURL(pluginUrl);
}
EditorGUI.BeginChangeCheck();
var doNotShow = GUILayout.Toggle(toggleState, "Do not prompt for this version again.");
if (EditorGUI.EndChangeCheck())
{
toggleState = doNotShow;
var key = string.Format(doNotShowKey, version);
if (doNotShow)
EditorPrefs.SetBool(key, true);
else
EditorPrefs.DeleteKey(key);
}
}
19
Source : ConfigureMenu.cs
with MIT License
from dag10
with MIT License
from dag10
[MenuItem("HoloToolkit/Configure/Show Help", false, 3)]
public static void ShowHelp()
{
Application.OpenURL("https://developer.microsoft.com/en-us/windows/holographic/unity_development_overview#Configuring_a_Unity_project_for_HoloLens");
}
19
Source : XcodeEditorWindow.cs
with GNU Lesser General Public License v3.0
from Egomotion
with GNU Lesser General Public License v3.0
from Egomotion
void DrawHelp()
{
if (_style.HelpButton("Help"))
{
Application.OpenURL("https://egomotion.co.uk/egoXproject");
}
}
19
Source : Button_OnClick.cs
with MIT License
from ehsan-mohammadi
with MIT License
from ehsan-mohammadi
public void Ehsan_OnClick()
{
Application.OpenURL("https://instagram.com/ehsanmhmdi/");
}
19
Source : MenuHook.cs
with MIT License
from Filigrani
with MIT License
from Filigrani
private static void Prefix(int index, BasicMenu __instance)
{
IL2CPP.List<BasicMenu.BasicMenuItemModel> list = __instance.m_ItemModelList;
if (list.get_Item(index).m_LabelText == "Donaters")
{
Application.OpenURL("https://filigrani.github.io/SkyCoop/");
}
if (list.get_Item(index).m_LabelText == "Connect")
{
//For Debug Alone
bool DebugAlone = false;
bool ConnectedScreenTest = false;
bool KickTest = false;
if(ConnectedScreenTest == true)
{
MyMod.DoWaitForConnect();
if(KickTest == true)
{
MyMod.DoKickMessage("Wrong mod version! Server using version " + MyMod.BuildInfo.Version);
}
}else{
if (DebugAlone == true)
{
MyMod.SaveSlotSync SaveData = new MyMod.SaveSlotSync();
SaveData.m_SaveSlotType = (int)SaveSlotType.SANDBOX;
SaveData.m_Episode = (int)Episode.One;
SaveData.m_ExperienceMode = (int)ExperienceModeType.Stalker;
SaveData.m_Location = (int)GameRegion.LakeRegion;
SaveData.m_Seed = 22566665;
//SaveData.m_Seed = -1541615651;
MyMod.PendingSave = SaveData;
MyMod.CheckHaveSaveFileToJoin(SaveData);
}else{
InterfaceManager.m_Panel_Confirmation.AddConfirmation(Panel_Confirmation.ConfirmationType.Rename, "Input server address", "127.0.0.1", Panel_Confirmation.ButtonLayout.Button_2, "Connect", "GAMEPLAY_Cancel", Panel_Confirmation.Background.Transperent, null, null);
}
}
}
}
19
Source : Window.cs
with MIT License
from github-for-unity
with MIT License
from github-for-unity
private void GoToProfile(object obj)
{
var connection = (Connection) obj;
var uriString = new UriString(connection.Host).Combine(connection.Username);
Application.OpenURL(uriString);
}
19
Source : GitHubAuthenticationView.cs
with MIT License
from github-for-unity
with MIT License
from github-for-unity
private void OnGUILogin()
{
EditorGUI.BeginDisabledGroup(isBusy);
{
ShowMessage();
EditorGUILayout.Space();
GUILayout.BeginHorizontal();
{
username = EditorGUILayout.TextField(UsernameLabel, username, Styles.TextFieldStyle);
}
GUILayout.EndHorizontal();
EditorGUILayout.Space();
GUILayout.BeginHorizontal();
{
preplacedword = EditorGUILayout.PreplacedwordField(PreplacedwordLabel, preplacedword, Styles.TextFieldStyle);
}
GUILayout.EndHorizontal();
EditorGUILayout.Space();
ShowErrorMessage();
GUILayout.Space(Styles.BaseSpacing + 3);
GUILayout.BeginHorizontal();
{
GUILayout.FlexibleSpace();
if (GUILayout.Button(LoginButton) || (!isBusy && enterPressed))
{
GUI.FocusControl(null);
isBusy = true;
AuthenticationService.Login(username, preplacedword, DoRequire2fa, DoResult);
}
}
GUILayout.EndHorizontal();
if (OAuthCallbackManager.IsRunning)
{
GUILayout.Space(Styles.BaseSpacing + 3);
GUILayout.BeginHorizontal();
{
GUILayout.FlexibleSpace();
if (GUILayout.Button("Sign in with your browser", Styles.HyperlinkStyle))
{
GUI.FocusControl(null);
Application.OpenURL(oAuthOpenUrl);
}
}
GUILayout.EndHorizontal();
}
}
EditorGUI.EndDisabledGroup();
}
19
Source : GitHubEnterpriseAuthenticationView.cs
with MIT License
from github-for-unity
with MIT License
from github-for-unity
public override void OnGUI()
{
HandleEnterPressed();
EditorGUIUtility.labelWidth = 90f;
scroll = GUILayout.BeginScrollView(scroll);
{
GUILayout.BeginHorizontal(Styles.AuthHeaderBoxStyle);
{
GUILayout.Label(Authreplacedle, Styles.HeaderRepoLabelStyle);
}
GUILayout.EndHorizontal();
GUILayout.BeginVertical();
{
if (!hreplacederverMeta)
{
OnGUIHost();
}
else
{
EditorGUILayout.Space();
EditorGUI.BeginDisabledGroup(true);
{
GUILayout.BeginHorizontal();
{
serverAddress = EditorGUILayout.TextField(ServerAddressLabel, serverAddress, Styles.TextFieldStyle);
}
GUILayout.EndHorizontal();
}
EditorGUI.EndDisabledGroup();
if (!need2fa)
{
if (verifiablePreplacedwordAuthentication)
{
OnGUIUserPreplacedwordLogin();
}
else
{
OnGUITokenLogin();
}
if (OAuthCallbackManager.IsRunning)
{
GUILayout.Space(Styles.BaseSpacing + 3);
GUILayout.BeginHorizontal();
{
GUILayout.FlexibleSpace();
if (GUILayout.Button("Sign in with your browser", Styles.HyperlinkStyle))
{
GUI.FocusControl(null);
Application.OpenURL(oAuthOpenUrl);
}
}
GUILayout.EndHorizontal();
}
}
else
{
OnGUI2FA();
}
}
}
GUILayout.EndVertical();
}
GUILayout.EndScrollView();
}
19
Source : GvrMenu.cs
with MIT License
from harshitjuneja
with MIT License
from harshitjuneja
[MenuItem("GoogleVR/Doreplacedentation/Developers Site", false, 100)]
private static void OpenDoreplacedentation() {
Application.OpenURL("https://developers.google.com/vr");
}
19
Source : GvrMenu.cs
with MIT License
from harshitjuneja
with MIT License
from harshitjuneja
[MenuItem("GoogleVR/Doreplacedentation/Unity Guide", false, 100)]
private static void OpenUnityGuide() {
Application.OpenURL("https://developers.google.com/vr/unity/guide");
}
19
Source : GvrMenu.cs
with MIT License
from harshitjuneja
with MIT License
from harshitjuneja
[MenuItem("GoogleVR/Doreplacedentation/Release Notes", false, 100)]
private static void OpenReleaseNotes() {
Application.OpenURL("https://developers.google.com/vr/unity/release-notes");
}
19
Source : GvrMenu.cs
with MIT License
from harshitjuneja
with MIT License
from harshitjuneja
[MenuItem("GoogleVR/Doreplacedentation/Known Issues", false, 100)]
private static void OpenKnownIssues() {
Application.OpenURL("https://developers.google.com/vr/unity/release-notes#known_issues");
}
19
Source : GvrMenu.cs
with MIT License
from harshitjuneja
with MIT License
from harshitjuneja
[MenuItem("GoogleVR/Report Bug", false, 100)]
private static void OpenReportBug() {
Application.OpenURL("https://github.com/googlesamples/cardboard-unity/issues");
}
19
Source : ReadmeEditor.cs
with MIT License
from Interactml
with MIT License
from Interactml
public override void OnInspectorGUI()
{
var readme = (Readme)target;
Init();
foreach (var section in readme.sections)
{
float newspace = kSpace;
if (string.IsNullOrEmpty(section.heading)) newspace = 6;
GUILayout.Space(newspace);
if (!string.IsNullOrEmpty(section.heading))
{
GUILayout.Label(section.heading, HeadingStyle);
}
if (!string.IsNullOrEmpty(section.text))
{
GUILayout.Label(section.text, BodyStyle);
}
if (!string.IsNullOrEmpty(section.linkText))
{
if (LinkLabel(new GUIContent(section.linkText)))
{
Application.OpenURL(section.url);
}
}
}
}
19
Source : NodeEditorPreferences.cs
with MIT License
from Interactml
with MIT License
from Interactml
[PreferenceItem("Node Editor")]
#endif
private static void PreferencesGUI() {
VerifyLoaded();
Settings settings = NodeEditorPreferences.settings[lastKey];
if (GUILayout.Button(new GUIContent("Doreplacedentation", "https://github.com/Siccity/xNode/wiki"), GUILayout.Width(100))) Application.OpenURL("https://github.com/Siccity/xNode/wiki");
EditorGUILayout.Space();
NodeSettingsGUI(lastKey, settings);
GridSettingsGUI(lastKey, settings);
SystemSettingsGUI(lastKey, settings);
TypeColorsGUI(lastKey, settings);
if (GUILayout.Button(new GUIContent("Set Default", "Reset all values to default"), GUILayout.Width(120))) {
ResetPrefs();
}
}
19
Source : ExampleWindow.cs
with MIT License
from liangxiegame
with MIT License
from liangxiegame
[MenuItem("Window/Example01")]
private static void Open()
{
// CreateWebViewEditorWindow<ExampleWindow>(
// "Example",
// Application.dataPath + "/Web/HTML/index.html", 200, 530, 800, 600);
// var path = Application.dataPath.Replace("replacedets", string.Empty).CombinePath("WebApp/LearnVue/index.html");
// var path = Application.dataPath.Replace("replacedets", "WebApp/LearnVue") + "/index.html";
var path = "https://xiaozhuanlan.com/unirx";
Application.OpenURL(path);
// CreateWebViewEditorWindow<ExampleWindow>(
// "Example",
// path, 200, 530,
// 800, 600);
Log.I("path:{0}", path);
}
19
Source : PreferencesWindow.cs
with MIT License
from liangxiegame
with MIT License
from liangxiegame
[MenuItem(FrameworkMenuItems.Feedback, false, FrameworkMenuItemsPriorities.Feedback)]
private static void Feedback()
{
Application.OpenURL(URL_GITHUB_ISSUE);
}
19
Source : OpenURLOnClick.cs
with MIT License
from mamoniem
with MIT License
from mamoniem
void OnClick ()
{
UILabel lbl = GetComponent<UILabel>();
if (lbl != null)
{
string url = lbl.GetUrlAtPosition(UICamera.lastWorldPosition);
if (!string.IsNullOrEmpty(url)) Application.OpenURL(url);
}
}
19
Source : NGUIHelp.cs
with MIT License
from mamoniem
with MIT License
from mamoniem
static public void Show ()
{
Application.OpenURL("http://www.tasharen.com/forum/index.php?topic=6754");
}
19
Source : NGUIHelp.cs
with MIT License
from mamoniem
with MIT License
from mamoniem
static public void Show (Type type)
{
string url = GetHelpURL(type);
if (url == null) url = "http://www.tasharen.com/ngui/doc.php?topic=" + type;
Application.OpenURL(url);
}
19
Source : NGUIContextMenu.cs
with MIT License
from mamoniem
with MIT License
from mamoniem
static public void AddHelp (GameObject go, bool addSeparator)
{
MonoBehaviour[] comps = Selection.activeGameObject.GetComponents<MonoBehaviour>();
bool addedSomething = false;
for (int i = 0; i < comps.Length; ++i)
{
System.Type type = comps[i].GetType();
string url = NGUIHelp.GetHelpURL(type);
if (url != null)
{
if (addSeparator)
{
addSeparator = false;
AddSeparator("");
}
AddItem("Help/" + type, false, delegate(object obj) { Application.OpenURL(url); }, null);
addedSomething = true;
}
}
if (addedSomething) AddSeparator("Help/");
AddItem("Help/All Topics", false, delegate(object obj) { NGUIHelp.Show(); }, null);
}
19
Source : NGUIContextMenu.cs
with MIT License
from mamoniem
with MIT License
from mamoniem
[MenuItem("Help/NGUI Support Forum")]
static void ShowHelp01 (MenuCommand command) { Application.OpenURL("http://www.tasharen.com/forum/index.php?board=1.0"); }
19
Source : UI.cs
with MIT License
from newman55
with MIT License
from newman55
private void DrawTab(int tabId, ref UnityAction buttons)
{
var minWidth = GUILayout.MinWidth(mWindowSize.x);
switch (tabs[tabId])
{
case "Mods":
{
mScrollPosition[tabId] = GUILayout.BeginScrollView(mScrollPosition[tabId], minWidth, GUILayout.ExpandHeight(false));
var amountWidth = mColumns.Where(x => !x.skip).Sum(x => x.width);
var expandWidth = mColumns.Where(x => x.expand && !x.skip).Sum(x => x.width);
var mods = modEntries;
var colWidth = mColumns.Select(x =>
x.expand
? GUILayout.Width(x.width / expandWidth * (mWindowSize.x - 60 + expandWidth - amountWidth))
: GUILayout.Width(x.width)).ToArray();
GUILayout.BeginVertical("box");
GUILayout.BeginHorizontal("box");
for (int i = 0; i < mColumns.Count; i++)
{
if (mColumns[i].skip)
continue;
GUILayout.Label(mColumns[i].name, colWidth[i]);
}
GUILayout.EndHorizontal();
for (int i = 0, c = mods.Count; i < c; i++)
{
int col = -1;
GUILayout.BeginVertical("box");
GUILayout.BeginHorizontal();
GUILayout.BeginHorizontal(colWidth[++col]);
if (mods[i].OnGUI != null || mods[i].CanReload)
{
if (GUILayout.Button(mods[i].Info.DisplayName, GUI.skin.label, GUILayout.ExpandWidth(true)))
{
ShowModSettings = (ShowModSettings == i) ? -1 : i;
}
if (GUILayout.Button(ShowModSettings == i ? Textures.SettingsActive : Textures.SettingsNormal, settings))
{
ShowModSettings = (ShowModSettings == i) ? -1 : i;
}
}
else
{
GUILayout.Label(mods[i].Info.DisplayName);
}
if (!string.IsNullOrEmpty(mods[i].Info.HomePage))
{
GUILayout.Space(10);
if (GUILayout.Button(Textures.WWW, www))
{
Application.OpenURL(mods[i].Info.HomePage);
}
}
if (mods[i].NewestVersion != null)
{
GUILayout.Space(10);
GUILayout.Box(Textures.Updates, updates);
}
GUILayout.Space(20);
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal(colWidth[++col]);
GUILayout.Label(mods[i].Info.Version, GUILayout.ExpandWidth(false));
// if (string.IsNullOrEmpty(mods[i].Info.Repository))
// {
// GUI.color = new Color32(255, 81, 83, 255);
// GUILayout.Label("*");
// GUI.color = Color.white;
// }
GUILayout.EndHorizontal();
if (mods[i].ManagerVersion > GetVersion())
{
GUILayout.Label("<color=\"#CD5C5C\">Manager-" + mods[i].Info.ManagerVersion + "</color>", colWidth[++col]);
}
else if (gameVersion != VER_0 && mods[i].GameVersion > gameVersion)
{
GUILayout.Label("<color=\"#CD5C5C\">Game-" + mods[i].Info.GameVersion + "</color>", colWidth[++col]);
}
else if (mods[i].Requirements.Count > 0)
{
GUILayout.BeginHorizontal(colWidth[++col]);
mJoinList.Clear();
foreach (var item in mods[i].Requirements)
{
var id = item.Key;
var mod = FindMod(id);
mJoinList.Add(((mod == null || item.Value != null && item.Value > mod.Version || !mod.Active) && mods[i].Active) ? "<color=\"#CD5C5C\">" + id + "</color> " : id);
}
GUILayout.Label(string.Join(", ", mJoinList.ToArray()));
GUILayout.EndHorizontal();
}
else if (!string.IsNullOrEmpty(mods[i].CustomRequirements))
{
GUILayout.Label(mods[i].CustomRequirements, colWidth[++col]);
}
else
{
GUILayout.Label("-", colWidth[++col]);
}
if (!forbidDisableMods)
{
var action = mods[i].Enabled;
action = GUILayout.Toggle(action, "", colWidth[++col]);
if (action != mods[i].Enabled)
{
mods[i].Enabled = action;
if (mods[i].Toggleable)
mods[i].Active = action;
else if (action && !mods[i].Loaded)
mods[i].Active = action;
}
}
else
{
GUILayout.Label("", colWidth[++col]);
}
if (mods[i].Active)
{
GUILayout.Box(mods[i].Enabled ? Textures.StatusActive : Textures.StatusNeedRestart, status);
}
else
{
GUILayout.Box(!mods[i].Enabled ? Textures.StatusInactive : Textures.StatusNeedRestart, status);
}
if (mods[i].ErrorOnLoading)
GUILayout.Label("!!!");
GUILayout.EndHorizontal();
if (ShowModSettings == i)
{
if (mods[i].CanReload)
{
GUILayout.Label("Debug", h2);
if (GUILayout.Button("Reload", button, GUILayout.ExpandWidth(false)))
{
mods[i].Reload();
}
GUILayout.Space(5);
}
if (mods[i].Active && mods[i].OnGUI != null)
{
GUILayout.Label("Options", h2);
try
{
mods[i].OnGUI(mods[i]);
}
//catch (ExitGUIException e)
//{
// throw e;
//}
catch (Exception e)
{
mods[i].Logger.LogException("OnGUI", e);
ShowModSettings = -1;
GUIUtility.ExitGUI();
}
}
}
GUILayout.EndVertical();
}
GUILayout.EndVertical();
GUILayout.EndScrollView();
GUILayout.Space(10);
GUILayout.BeginHorizontal();
GUILayout.Space(10);
GUILayout.Box(Textures.SettingsNormal, settings);
GUILayout.Space(3);
GUILayout.Label("Options", GUILayout.ExpandWidth(false));
GUILayout.Space(15);
GUILayout.Box(Textures.WWW, www);
GUILayout.Space(3);
GUILayout.Label("Home page", GUILayout.ExpandWidth(false));
GUILayout.Space(15);
GUILayout.Box(Textures.Updates, updates);
GUILayout.Space(3);
GUILayout.Label("Available update", GUILayout.ExpandWidth(false));
GUILayout.Space(15);
GUILayout.Box(Textures.StatusActive, status);
GUILayout.Space(3);
GUILayout.Label("Active", GUILayout.ExpandWidth(false));
GUILayout.Space(10);
GUILayout.Box(Textures.StatusInactive, status);
GUILayout.Space(3);
GUILayout.Label("Inactive", GUILayout.ExpandWidth(false));
GUILayout.Space(10);
GUILayout.Box(Textures.StatusNeedRestart, status);
GUILayout.Space(3);
GUILayout.Label("Need restart", GUILayout.ExpandWidth(false));
GUILayout.Space(10);
GUILayout.Label("!!!", GUILayout.ExpandWidth(false));
GUILayout.Space(3);
GUILayout.Label("Errors", GUILayout.ExpandWidth(false));
GUILayout.Space(10);
GUILayout.Label("[CTRL + LClick]", bold, GUILayout.ExpandWidth(false));
GUILayout.Space(3);
GUILayout.Label("Drag window", GUILayout.ExpandWidth(false));
// GUILayout.Space(10);
// GUI.color = new Color32(255, 81, 83, 255);
// GUILayout.Label("*", bold, GUILayout.ExpandWidth(false));
// GUI.color = Color.white;
// GUILayout.Space(3);
// GUILayout.Label("Not support updates", GUILayout.ExpandWidth(false));
GUILayout.EndHorizontal();
if (GUI.changed)
{
}
break;
}
case "Logs":
{
mScrollPosition[tabId] = GUILayout.BeginScrollView(mScrollPosition[tabId], minWidth);
GUILayout.BeginVertical("box");
for (int c = Logger.history.Count, i = Mathf.Max(0, c - Logger.historyCapacity); i < c; i++)
{
GUILayout.Label(Logger.history[i]);
}
GUILayout.EndVertical();
GUILayout.EndScrollView();
buttons += delegate
{
if (GUILayout.Button("Clear", button, GUILayout.ExpandWidth(false)))
{
Logger.Clear();
}
if (GUILayout.Button("Open detailed log", button, GUILayout.ExpandWidth(false)))
{
OpenUnityFileLog();
}
};
break;
}
case "Settings":
{
mScrollPosition[tabId] = GUILayout.BeginScrollView(mScrollPosition[tabId], minWidth);
GUILayout.BeginVertical("box");
GUILayout.BeginHorizontal();
GUILayout.Label("Hotkey (default Ctrl+F10)", GUILayout.ExpandWidth(false));
DrawKeybinding(ref Params.Hotkey, "UMMHotkey", null, GUILayout.ExpandWidth(false));
GUILayout.EndHorizontal();
GUILayout.Space(5);
GUILayout.BeginHorizontal();
GUILayout.Label("Check updates", GUILayout.ExpandWidth(false));
ToggleGroup(Params.CheckUpdates, mCheckUpdateStrings, i => { Params.CheckUpdates = i; }, null, GUILayout.ExpandWidth(false));
GUILayout.EndHorizontal();
GUILayout.Space(5);
GUILayout.BeginHorizontal();
GUILayout.Label("Show this window on startup", GUILayout.ExpandWidth(false));
ToggleGroup(Params.ShowOnStart, mShowOnStartStrings, i => { Params.ShowOnStart = i; }, null, GUILayout.ExpandWidth(false));
GUILayout.EndHorizontal();
GUILayout.Space(5);
GUILayout.BeginVertical("box");
GUILayout.Label("Window size", bold, GUILayout.ExpandWidth(false));
GUILayout.BeginHorizontal();
GUILayout.Label("Width ", GUILayout.ExpandWidth(false));
mExpectedWindowSize.x = GUILayout.HorizontalSlider(mExpectedWindowSize.x, Mathf.Min(Screen.width, 960), Screen.width, GUILayout.Width(200));
GUILayout.Label(" " + mExpectedWindowSize.x.ToString("f0") + " px ", GUILayout.ExpandWidth(false));
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
GUILayout.Label("Height", GUILayout.ExpandWidth(false));
mExpectedWindowSize.y = GUILayout.HorizontalSlider(mExpectedWindowSize.y, Mathf.Min(Screen.height, 720), Screen.height, GUILayout.Width(200));
GUILayout.Label(" " + mExpectedWindowSize.y.ToString("f0") + " px ", GUILayout.ExpandWidth(false));
GUILayout.EndHorizontal();
if (GUILayout.Button("Apply", button, GUILayout.ExpandWidth(false)))
{
mWindowSize.x = Mathf.Floor(mExpectedWindowSize.x) % 2 > 0 ? Mathf.Ceil(mExpectedWindowSize.x) : Mathf.Floor(mExpectedWindowSize.x);
mWindowSize.y = Mathf.Floor(mExpectedWindowSize.y) % 2 > 0 ? Mathf.Ceil(mExpectedWindowSize.y) : Mathf.Floor(mExpectedWindowSize.y);
CalculateWindowPos();
Params.WindowWidth = mWindowSize.x;
Params.WindowHeight = mWindowSize.y;
}
GUILayout.EndVertical();
GUILayout.Space(5);
GUILayout.BeginVertical("box");
GUILayout.Label("UI", bold, GUILayout.ExpandWidth(false));
GUILayout.BeginHorizontal();
GUILayout.Label("Scale", GUILayout.ExpandWidth(false), GUILayout.ExpandWidth(false));
mExpectedUIScale = GUILayout.HorizontalSlider(mExpectedUIScale, 0.5f, 2f, GUILayout.Width(200));
GUILayout.Label(" " + mExpectedUIScale.ToString("f2"), GUILayout.ExpandWidth(false));
GUILayout.EndHorizontal();
if (GUILayout.Button("Apply", button, GUILayout.ExpandWidth(false)))
{
if (mUIScale != mExpectedUIScale)
{
mUIScaleChanged = true;
mUIScale = mExpectedUIScale;
Params.UIScale = mUIScale;
}
}
GUILayout.EndVertical();
GUILayout.EndVertical();
GUILayout.EndScrollView();
break;
}
}
}
19
Source : Utils.cs
with MIT License
from newman55
with MIT License
from newman55
public static void OpenUnityFileLog()
{
var folders = new string[] { Application.persistentDataPath, Application.dataPath };
var files = new string[] { "Player.log", "output_log.txt" };
foreach (var folder in folders)
{
foreach (var file in files)
{
var filepath = Path.Combine(folder, file);
if (File.Exists(filepath))
{
Thread.Sleep(500);
Application.OpenURL(filepath);
return;
}
}
}
}
19
Source : AppUI.cs
with MIT License
from NRatel
with MIT License
from NRatel
private void RegisterEvents()
{
this.m_Btn_ContactMe.onClick.AddListener(()=> {
Application.OpenURL("https://blog.csdn.net/NRatel/article/details/85009462");
});
}
See More Examples