This commit is contained in:
GL 2024-11-26 16:28:41 +08:00
commit d6bcb3dc91
4 changed files with 14 additions and 9 deletions

View File

@ -35,7 +35,7 @@ public class TradeDes : MonoBehaviour
public GameObject detailPrefab; public GameObject detailPrefab;
public Transform canvasTrans; public Transform trans;
// Start is called before the first frame update // Start is called before the first frame update
void Awake() void Awake()
@ -61,10 +61,10 @@ public class TradeDes : MonoBehaviour
public void ShowDetail() public void ShowDetail()
{ {
GameObject.Instantiate(detailPrefab, canvasTrans); GameObject.Instantiate(detailPrefab, trans);
} }
public void SetInfo(UnionDataInPage body) public void SetInfo(UnionDataInPage body,Transform tran)
{ {
id = body.Id; id = body.Id;
name = body.Name; name = body.Name;
@ -76,7 +76,7 @@ public class TradeDes : MonoBehaviour
createTime = body.CreateTime; createTime = body.CreateTime;
updateTime = body.UpdateTime; updateTime = body.UpdateTime;
nameTxt.text = name; nameTxt.text = name;
trans = tran;
} }
} }

View File

@ -15,6 +15,7 @@ public class TradeUnion : MonoBehaviour
{ {
ReadData(); ReadData();
//testLogo();
} }
public async void ReadData() public async void ReadData()
@ -30,15 +31,18 @@ public class TradeUnion : MonoBehaviour
GameObject union = GameObject.Instantiate(gonghuiPrefab, content); GameObject union = GameObject.Instantiate(gonghuiPrefab, content);
union.name = "union_" + i; union.name = "union_" + i;
TradeDes tradeDes = union.GetComponent<TradeDes>(); TradeDes tradeDes = union.GetComponent<TradeDes>();
tradeDes.SetInfo(unionPage.Data.DataList[i]); tradeDes.SetInfo(unionPage.Data.DataList[i],transform);
} }
} }
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
//testhead
//string response511 = await web.SendRequest(web.URL + "/snail/gameEscape/queryLatest", "POST", body, testhead);
//string response511 = await web.SendRequest(web.URL + "/snail/gameEscape/queryLatest", "POST", body, Global.global.CreateHeaders());
} }
} }

View File

@ -768,7 +768,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0.003112793, y: 333.97394} m_AnchoredPosition: {x: 0, y: 334}
m_SizeDelta: {x: 992.71, y: 218.7623} m_SizeDelta: {x: 992.71, y: 218.7623}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &8133399435849918391 --- !u!114 &8133399435849918391
@ -797,7 +797,7 @@ MonoBehaviour:
panelBtn: {fileID: 5568445523757616195} panelBtn: {fileID: 5568445523757616195}
nameTxt: {fileID: 6604778934918701610} nameTxt: {fileID: 6604778934918701610}
detailPrefab: {fileID: 1001758454263862282, guid: 24d39cbc0ad9ddc4188e8448773f23c3, type: 3} detailPrefab: {fileID: 1001758454263862282, guid: 24d39cbc0ad9ddc4188e8448773f23c3, type: 3}
canvasTrans: {fileID: 0} trans: {fileID: 0}
--- !u!114 &5568445523757616195 --- !u!114 &5568445523757616195
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -702,7 +702,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 146.20752} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1164.6345, y: 1281.8242} m_SizeDelta: {x: 1164.6345, y: 1281.8242}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1001758454263862279 --- !u!222 &1001758454263862279
@ -725,6 +725,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d28b93aa3e27efe459ed3371d2072596, type: 3} m_Script: {fileID: 11500000, guid: d28b93aa3e27efe459ed3371d2072596, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
retbutton: {fileID: 0}
id: 0 id: 0
name: name:
cover: cover: