diff --git a/FuZhou_FirstPage/Assets/Scenes/MainScene.unity b/FuZhou_FirstPage/Assets/Scenes/MainScene.unity index d588b1d2..83cfb3a2 100644 --- a/FuZhou_FirstPage/Assets/Scenes/MainScene.unity +++ b/FuZhou_FirstPage/Assets/Scenes/MainScene.unity @@ -1370,7 +1370,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 4 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &802089282 PrefabInstance: @@ -3420,7 +3420,7 @@ RectTransform: m_Children: - {fileID: 1630019883} m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -4249,36 +4249,6 @@ RectTransform: type: 3} m_PrefabInstance: {fileID: 2081707619} m_PrefabAsset: {fileID: 0} ---- !u!1 &2123277917 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2123277918} - m_Layer: 0 - m_Name: manager - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2123277918 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2123277917} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2123684705 GameObject: m_ObjectHideFlags: 0 @@ -4749,6 +4719,8 @@ MonoBehaviour: nameText: {fileID: 2403617721991577379} nochoseSprite: {fileID: 21300000, guid: 38e974ed426be9a468ecc732dec5e66c, type: 3} choseSprite: {fileID: 21300000, guid: 4ced2e7e9bfb6264c8d023a85800ac43, type: 3} + nochoseFont: {fileID: 0} + choseFont: {fileID: 0} --- !u!114 &2403617721991577379 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/FuZhou_FirstPage/Assets/Scripts/CityPanel.cs b/FuZhou_FirstPage/Assets/Scripts/CityPanel.cs index e0614f16..cc1f76df 100644 --- a/FuZhou_FirstPage/Assets/Scripts/CityPanel.cs +++ b/FuZhou_FirstPage/Assets/Scripts/CityPanel.cs @@ -14,28 +14,30 @@ public class CityPanel : MonoBehaviour { //获取关区下所有企业信息 string url = "http://"+FirstPanel.instance.serverIP+":4000/api/Corporation/GetAllPosition?customCodes="+custCodes; - FirstPanel.instance.CallGet(url, (isok,result) => + Debug.Log("获取企业模型:"+url); + StartCoroutine(FirstPanel.instance.CallGet(url, (isok, result) => { - if(isok) + if (isok) { - JsonData data = new JsonData(result); - string tmp=data["data"].ToString(); - var models = JsonMapper.ToObject>(tmp); - - models.ForEach(a => + Debug.Log(result); + JsonData data = JsonMapper.ToObject(result); + var tmp = data["data"]; + foreach (JsonData item in tmp) { + v_model_version v= JsonMapper.ToObject(item.ToJson()); if (ModelItem.modelItemPrefb == null) { ModelItem.modelItemPrefb = Resources.Load("prefeb/modelItem"); } GameObject go = Instantiate(ModelItem.modelItemPrefb, transform); - go.GetComponent().Init(a); - }); + go.GetComponent().Init(v); + } + } else { Debug.LogError(result); } - }); + })); } } diff --git a/FuZhou_FirstPage/Assets/Scripts/FirstPanel.cs b/FuZhou_FirstPage/Assets/Scripts/FirstPanel.cs index 7da87d45..892e43e5 100644 --- a/FuZhou_FirstPage/Assets/Scripts/FirstPanel.cs +++ b/FuZhou_FirstPage/Assets/Scripts/FirstPanel.cs @@ -57,6 +57,9 @@ public class FirstPanel : MonoBehaviour }); }); + //初始化 + Application.ExternalCall("OnWake"); + #if UNITY_EDITOR serverIP = "172.16.1.164"; #endif @@ -69,6 +72,7 @@ public class FirstPanel : MonoBehaviour public void InitUnity(string serverIP) { this.serverIP= serverIP; + Debug.Log("接收IP:"+serverIP); }