Exemplo n.º 1
0
        public static void LaunchSuccess(string url)
        {
            BuildUploadCompletedWindow buildUploadCompletedWindow = BuildUploadCompletedWindow.Launch();

            buildUploadCompletedWindow.title      = BuildUploadCompletedWindow.s_Content.m_WindowTitleSuccess.text;
            buildUploadCompletedWindow.m_Success  = true;
            buildUploadCompletedWindow.m_URL      = url;
            buildUploadCompletedWindow.m_ShortURL = BuildUploadCompletedWindow.ShortenURL(url);
        }
Exemplo n.º 2
0
        private static BuildUploadCompletedWindow Launch()
        {
            BuildUploadCompletedWindow window = EditorWindow.GetWindow <BuildUploadCompletedWindow>(true);

            window.position = new Rect(100f, 100f, 470f, 170f);
            window.minSize  = new Vector2(470f, 170f);
            window.maxSize  = new Vector2(470f, 170f);
            return(window);
        }
Exemplo n.º 3
0
        private static BuildUploadCompletedWindow LaunchFailure(string message)
        {
            BuildUploadCompletedWindow buildUploadCompletedWindow = BuildUploadCompletedWindow.Launch();

            buildUploadCompletedWindow.title          = BuildUploadCompletedWindow.s_Content.m_WindowTitleFailure.text;
            buildUploadCompletedWindow.m_Success      = false;
            buildUploadCompletedWindow.m_ErrorMessage = message;
            return(buildUploadCompletedWindow);
        }
Exemplo n.º 4
0
 private void OnSuccessGUI()
 {
     GUILayout.Label(BuildUploadCompletedWindow.s_Content.m_TextHeaderSuccess.text, EditorStyles.boldLabel, new GUILayoutOption[0]);
     GUILayout.Label(BuildUploadCompletedWindow.s_Content.m_MainTextSuccess.text, EditorStyles.wordWrappedLabel, new GUILayoutOption[0]);
     GUILayout.Space(4f);
     this.CopyLabel(this.m_ShortURL, BuildUploadCompletedWindow.s_Content.m_DidCopyToClipboardMessage.text);
     GUILayout.FlexibleSpace();
     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
     GUILayout.FlexibleSpace();
     if (this.LinkLabel(BuildUploadCompletedWindow.s_Content.m_OpenInBrowser))
     {
         Application.OpenURL(this.m_URL);
     }
     GUILayout.Space(10f);
     if (this.LinkLabel(BuildUploadCompletedWindow.s_Content.m_Tweet))
     {
         Application.OpenURL(BuildUploadCompletedWindow.GetShareURL(this.m_ShortURL, BuildUploadCompletedWindow.s_Content.m_ShareMessage.text, BuildUploadCompletedWindow.SocialNetwork.Twitter));
     }
     GUILayout.Space(10f);
     if (this.LinkLabel(BuildUploadCompletedWindow.s_Content.m_LinkedInShare))
     {
         Application.OpenURL(BuildUploadCompletedWindow.GetShareURL(this.m_ShortURL, BuildUploadCompletedWindow.s_Content.m_ShareMessage.text, BuildUploadCompletedWindow.SocialNetwork.LinkedIn));
     }
     GUILayout.Space(10f);
     if (this.LinkLabel(BuildUploadCompletedWindow.s_Content.m_FacebookShare))
     {
         Application.OpenURL(BuildUploadCompletedWindow.GetShareURL(this.m_ShortURL, BuildUploadCompletedWindow.s_Content.m_ShareMessage.text, BuildUploadCompletedWindow.SocialNetwork.Facebook));
     }
     GUILayout.Space(5f);
     GUILayout.EndHorizontal();
     GUILayout.FlexibleSpace();
     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
     GUILayout.FlexibleSpace();
     if (GUILayout.Button(BuildUploadCompletedWindow.s_Content.m_CloseButton.text, new GUILayoutOption[]
     {
         GUILayout.Width(120f),
         GUILayout.Height(20f)
     }))
     {
         base.Close();
     }
     GUILayout.EndHorizontal();
 }
Exemplo n.º 5
0
 public static void LaunchFailureCritical(string message)
 {
     BuildUploadCompletedWindow.LaunchFailure(message).m_RecoverableError = false;
 }
Exemplo n.º 6
0
 public static void LaunchFailureRecoverable(string message)
 {
     BuildUploadCompletedWindow.LaunchFailure(message).m_RecoverableError = true;
 }
		public static string GetShareURL(string url, string title, BuildUploadCompletedWindow.SocialNetwork network)
		{
			switch (network)
			{
			case BuildUploadCompletedWindow.SocialNetwork.LinkedIn:
				return string.Format("http://www.linkedin.com/shareArticle?title={0}&source=%3A%2F%2Funity3d.com&url={1}", WWW.EscapeURL(title), WWW.EscapeURL(url));
			case BuildUploadCompletedWindow.SocialNetwork.Facebook:
				return string.Format("http://www.facebook.com/sharer.php?t={0}&u={1}", WWW.EscapeURL(title), WWW.EscapeURL(url));
			case BuildUploadCompletedWindow.SocialNetwork.Twitter:
				return string.Format("http://twitter.com/share?text={0}+{1}+%23unity3d", WWW.EscapeURL(title), WWW.EscapeURL(url));
			default:
				throw new ArgumentException(string.Format("Social network {0} not supported", network));
			}
		}