Ejemplo n.º 1
0
        private void ShowUserMenu(Rect dropDownRect)
        {
            GenericMenu genericMenu = new GenericMenu();

            if (!UnityConnect.instance.online)
            {
                genericMenu.AddDisabledItem(new GUIContent("Go to account"));
                genericMenu.AddDisabledItem(new GUIContent("Sign in..."));
                if (!Application.HasProLicense())
                {
                    genericMenu.AddSeparator(string.Empty);
                    genericMenu.AddDisabledItem(new GUIContent("Upgrade to Pro"));
                }
            }
            else
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                Toolbar.\u003CShowUserMenu\u003Ec__AnonStorey77 menuCAnonStorey77 = new Toolbar.\u003CShowUserMenu\u003Ec__AnonStorey77();
                // ISSUE: reference to a compiler-generated field
                menuCAnonStorey77.accountUrl = UnityConnect.instance.GetConfigurationURL(CloudConfigUrl.CloudWebauth);
                if (UnityConnect.instance.loggedIn)
                {
                    // ISSUE: reference to a compiler-generated method
                    genericMenu.AddItem(new GUIContent("Go to account"), false, new GenericMenu.MenuFunction(menuCAnonStorey77.\u003C\u003Em__10F));
                }
                else
                {
                    genericMenu.AddDisabledItem(new GUIContent("Go to account"));
                }
                if (UnityConnect.instance.loggedIn)
                {
                    string text = "Sign out " + UnityConnect.instance.userInfo.displayName;
                    genericMenu.AddItem(new GUIContent(text), false, (GenericMenu.MenuFunction)(() => UnityConnect.instance.Logout()));
                }
                else
                {
                    genericMenu.AddItem(new GUIContent("Sign in..."), false, (GenericMenu.MenuFunction)(() => UnityConnect.instance.ShowLogin()));
                }
                if (!Application.HasProLicense())
                {
                    genericMenu.AddSeparator(string.Empty);
                    genericMenu.AddItem(new GUIContent("Upgrade to Pro"), false, (GenericMenu.MenuFunction)(() => Application.OpenURL("https://store.unity3d.com/")));
                }
            }
            genericMenu.DropDown(dropDownRect);
        }
Ejemplo n.º 2
0
 private void ShowUserMenu(Rect dropDownRect)
 {
   GenericMenu genericMenu = new GenericMenu();
   if (!UnityConnect.instance.online)
   {
     genericMenu.AddDisabledItem(new GUIContent("Go to account"));
     genericMenu.AddDisabledItem(new GUIContent("Sign in..."));
     if (!Application.HasProLicense())
     {
       genericMenu.AddSeparator(string.Empty);
       genericMenu.AddDisabledItem(new GUIContent("Upgrade to Pro"));
     }
   }
   else
   {
     // ISSUE: object of a compiler-generated type is created
     // ISSUE: variable of a compiler-generated type
     Toolbar.\u003CShowUserMenu\u003Ec__AnonStorey77 menuCAnonStorey77 = new Toolbar.\u003CShowUserMenu\u003Ec__AnonStorey77();
     // ISSUE: reference to a compiler-generated field
     menuCAnonStorey77.accountUrl = UnityConnect.instance.GetConfigurationURL(CloudConfigUrl.CloudWebauth);
     if (UnityConnect.instance.loggedIn)
     {
       // ISSUE: reference to a compiler-generated method
       genericMenu.AddItem(new GUIContent("Go to account"), false, new GenericMenu.MenuFunction(menuCAnonStorey77.\u003C\u003Em__10F));
     }
     else
       genericMenu.AddDisabledItem(new GUIContent("Go to account"));
     if (UnityConnect.instance.loggedIn)
     {
       string text = "Sign out " + UnityConnect.instance.userInfo.displayName;
       genericMenu.AddItem(new GUIContent(text), false, (GenericMenu.MenuFunction) (() => UnityConnect.instance.Logout()));
     }
     else
       genericMenu.AddItem(new GUIContent("Sign in..."), false, (GenericMenu.MenuFunction) (() => UnityConnect.instance.ShowLogin()));
     if (!Application.HasProLicense())
     {
       genericMenu.AddSeparator(string.Empty);
       genericMenu.AddItem(new GUIContent("Upgrade to Pro"), false, (GenericMenu.MenuFunction) (() => Application.OpenURL("https://store.unity3d.com/")));
     }
   }
   genericMenu.DropDown(dropDownRect);
 }