胡佳骏 před 1 rokem
rodič
revize
82413cb721

+ 8 - 0
Assets/2.0/Tools.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 1f2487a9013c8da419cf02037ff0632e
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Assets/2.0/Tools/DownLoadItem.cs

@@ -0,0 +1,8 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class DownLoadItem : MonoBehaviour
+{
+  
+}

+ 11 - 0
Assets/2.0/Tools/DownLoadItem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 30caa1bb4f17035489ec6527111ef2de
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Assets/2.0/User/Model.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: dbcc64eff31e7c44196bb61ed609ec78
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 7 - 0
Assets/2.0/User/Model/ModelItem.cs

@@ -0,0 +1,7 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class ModelItem 
+{
+}

+ 11 - 0
Assets/2.0/User/Model/ModelItem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a06336b9c9d51d142bf1de5ce92860fb
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 21 - 0
Assets/2.0/User/Model/ModelManager.cs

@@ -0,0 +1,21 @@
+using Newtonsoft.Json.Linq;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class ModelManager : Singleton<ModelManager>
+{
+    public void init(string message)
+    {
+        GameManager.Instance.text.text = " »ñÈ¡ËزÄÁбí";
+        JObject jObject = JObject.Parse(message);
+        string data = jObject["data"].ToString();
+
+        JObject dataObject = JObject.Parse(data);
+
+        string single = dataObject["single"].ToString();
+        string library = dataObject["library"].ToString();
+        string combination = dataObject["combination"].ToString();
+
+    }
+}

+ 11 - 0
Assets/2.0/User/Model/ModelManager.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7f1bfbbd7df46cc4aa246eab50e49b52
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 19 - 8
Assets/2.0/User/UserManager.cs

@@ -1,16 +1,27 @@
+using Newtonsoft.Json.Linq;
 using SC.XR.Unity;
+using UnityEngine;
 
 public class UserManager : SingletonMono<UserManager>
 {
-    // Start is called before the first frame update
-    void Start()
+    public void loginBack(bool isLogin)
     {
-        
-    }
+        if (isLogin)
+        {
+
+            HttpTool.Instance.GetAllMaterials("/material/init", "", (string msg)=> {
+
+                Debug.Log("/material/init===>" + msg);
+                ModelManager.Instance.init(msg);
+            
+            });
+
+            HttpTool.Instance.Get("/project/index", (string msg) => {
+
+                Debug.Log("/project/index===>" + msg);
+
+            });
+        }
 
-    // Update is called once per frame
-    void Update()
-    {
-        
     }
 }

+ 1 - 0
Assets/Scripts/Net/HttpTool.cs

@@ -164,6 +164,7 @@ public class HttpTool : MonoSingleton<HttpTool>
             }
             yield return webRequest.SendWebRequest();
 
+            Debug.Log("CallBack==>"+ webRequest.downloadHandler.text);
             if (webRequest.isHttpError || webRequest.isNetworkError)
             {
                 Debug.LogError(url + "\n" + webRequest.error + "\n" + webRequest.downloadHandler.text);

+ 30 - 4
Assets/Scripts/UI/LoginPanel.cs

@@ -251,9 +251,9 @@ public class LoginPanel : BaseUI
     {
 
 #if UNITY_EDITOR
-       // m_AccountStr = "ghztest2@ghz-tech.com";
-       // m_PasswordStr = "123456Aa";
-        m_AccountStr = "ghztest2@ghz-tech.com";
+        // m_AccountStr = "ghztest2@ghz-tech.com";
+        // m_PasswordStr = "123456Aa";
+        m_AccountStr = "yhb_adv10@1.com";
         m_PasswordStr = "123456Aa";
 #endif
 
@@ -296,7 +296,7 @@ public class LoginPanel : BaseUI
         HttpTool.is20 = true;
         if(HttpTool.is20)
         {
-            HttpTool.Instance.PostLogin("/user/login", jsonLogin, LoginCallBack);
+            HttpTool.Instance.PostLogin("/user/login", jsonLogin, LoginCallBack2);
         }
         else
         {
@@ -304,6 +304,32 @@ public class LoginPanel : BaseUI
         }
     }
 
+    /// <summary>
+    /// 登录返回数据
+    /// </summary>
+    /// <param name="message"></param>
+    public void LoginCallBack2(string mes)
+    {
+        //Debug.Log(mes);
+        JObject obj = JObject.Parse(mes);
+        if (obj["code"].ToString() != "200")
+        {
+            m_Logn.interactable = true;
+            m_AccountError.gameObject.SetActive(true);
+            m_AccountErrorStr.text = obj["message"].ToString();
+            UIManager.Instance.HideUI(UINameConfig.LoadingPanel);
+            UserManager.Instance.loginBack(false);
+            return;
+
+        }
+        else
+        {
+            UserInfo.Instance.Token = obj["data"]["token"].ToString();
+            //  UIManager.Instance.ShowUI(UINameConfig.LoadingPanel, typeof(LoadingPanel), (int)ELoadState.getMaterialValue);
+            //   StartCoroutine(GetAllMaterials(UserInfo.Instance.Token));
+            UserManager.Instance.loginBack(true);
+        }
+    }
     /// <summary>
     /// 登录返回数据
     /// </summary>