상속: Response
예제 #1
0
        public void OnGUI()
        {
            GUIHelpers.IsInsepctor = false;
            //if (string.IsNullOrEmpty(MarketPlace.Token) || jsonInfo == null || string.IsNullOrEmpty(MarketPlace.Cookies))
            //{
            DoLoginScreen();
            if (GUILayout.Button("Logout"))
            {
                MarketPlace.Token = null;
                MarketPlace.Cookies = null;
                loginResponse = null;
                jsonInfo = null;
            }
            //}
            //else
            //{
            //    if (jsonInfo == null)
            //    {
            //        jsonInfo = MarketPlace.GetMarketInfo();
            //    }
            //    if (jsonInfo == null)
            //    {
            //        return;
            //    }
            //    DoMarketScreen();
            //}


        }
예제 #2
0
 private void DoLoginScreen()
 {
     if (loginResponse != null && !loginResponse.Success)
     {
         EditorGUILayout.HelpBox(loginResponse.Message, MessageType.Error);
     }
     username = EditorGUILayout.TextField("Username:"******"Password:"******"Login"))
     {
         loginResponse = MarketPlace.Login(username, password);
         jsonInfo = MarketPlace.GetMarketInfo();
     }
 }
예제 #3
0
        private void DoMarketScreen()
        {
            foreach (var item in jsonInfo.MarketItems)
            {

                if (
                    GUIHelpers.DoTriggerButton(new UFStyle(string.Format("{0} {1:C}", item.Name, item.Price),
                        ElementDesignerStyles.EventButtonStyleSmall)
                    {
                        FullWidth = false
                    }))
                {

                }
            }
            if (GUILayout.Button("Logout"))
            {
                MarketPlace.Token = null;
                MarketPlace.Cookies = null;
                loginResponse = null;
                jsonInfo = null;
            }
        }