锻造数据接口的接入

This commit is contained in:
liuliang 2025-01-08 19:59:23 +08:00
parent 78e3511841
commit 9db2b8a811
7 changed files with 495 additions and 1701 deletions

View File

@ -115,9 +115,9 @@ RectTransform:
m_Father: {fileID: 6931136036740879336}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 80.5, y: -76.78015}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -383, y: -88.3291}
m_SizeDelta: {x: 160, y: 71}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1821575073
@ -214,13 +214,14 @@ GameObject:
- component: {fileID: 6931136036260294095}
- component: {fileID: 6931136036260294092}
- component: {fileID: 1553952866}
- component: {fileID: 8559187767973888654}
m_Layer: 5
m_Name: Asset_Details
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &6931136036260294093
RectTransform:
m_ObjectHideFlags: 0
@ -296,10 +297,70 @@ MonoBehaviour:
GetMoneyText: {fileID: 6931136036389693930}
GiveMoneyText: {fileID: 6931136037939810781}
HaveMoneyText: {fileID: 6931136036598575287}
time: {fileID: 6931136037991695987}
itemBoxPrefab: {fileID: 3085038604584877223, guid: ce7baf84b8801624aa22e8f29b4b95b7, type: 3}
itemBoxPrefabParent: {fileID: 6931136037450377241}
itemBoxPrefabList: []
itemPrefab: {fileID: 8800312809106112678, guid: 8b02cd965c34edb4ebf6d67db033ccd2, type: 3}
GiveawayBtn: {fileID: 1821575071}
GiveawayPanel: {fileID: 4862491904506907925, guid: d2b58f3aa93f9bc41aeff11c8f9b068f, type: 3}
mycanvas: {fileID: 0}
--- !u!114 &8559187767973888654
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6931136036260294082}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 6931136036260294092}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 6931136036260294082}
m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &6931136036319057909
GameObject:
m_ObjectHideFlags: 0
@ -414,7 +475,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.9113709, y: 0.9223356}
m_AnchorMax: {x: 0.961, y: 0.95217466}
m_AnchoredPosition: {x: -1.0323486, y: -0.10424805}
m_AnchoredPosition: {x: -1.0322266, y: -0.10424805}
m_SizeDelta: {x: 1.0089313, y: 9.5379925}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6931136036337460999
@ -546,7 +607,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.3867731, y: 0.31238765}
m_AnchorMax: {x: 0.6144091, y: 0.5555554}
m_AnchoredPosition: {x: -0.49395752, y: 0.23696136}
m_AnchoredPosition: {x: -0.49395752, y: 0.23695374}
m_SizeDelta: {x: 0.8004761, y: 0.35250854}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6931136036389693909
@ -765,7 +826,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.4028154, y: 0.5555554}
m_AnchorMax: {x: 0.5971991, y: 0.771}
m_AnchoredPosition: {x: 0.000015258789, y: -0.23100281}
m_AnchoredPosition: {x: 0, y: -0.23100281}
m_SizeDelta: {x: -2, y: -1}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6931136036426596621
@ -1001,7 +1062,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.7208031, y: 0.31238765}
m_AnchorMax: {x: 0.95080304, y: 0.5555554}
m_AnchoredPosition: {x: 0.013793945, y: 0.23696136}
m_AnchoredPosition: {x: 0.013793945, y: 0.23695374}
m_SizeDelta: {x: -1.1997681, y: 0.35251236}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6931136036598575286
@ -1243,7 +1304,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.020293808, y: 0.030495511}
m_AnchorMax: {x: 1, y: 0.6325045}
m_AnchoredPosition: {x: -8.999878, y: -0.5}
m_AnchoredPosition: {x: -8.999756, y: -0.5}
m_SizeDelta: {x: -54, y: -0.022827148}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6931136036741494347
@ -1871,8 +1932,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -32.415955, y: 0}
m_AnchoredPosition: {x: 0, y: -0.00024414062}
m_SizeDelta: {x: -32.415955, y: -723.68835}
m_Pivot: {x: 0.5, y: 1}
--- !u!114 &6931136037450377243
MonoBehaviour:
@ -2682,7 +2743,7 @@ GameObject:
- component: {fileID: 6931136037991695986}
- component: {fileID: 6931136037991695987}
m_Layer: 5
m_Name: Text (Legacy)
m_Name: DateTime
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

File diff suppressed because it is too large Load Diff

View File

@ -261,9 +261,9 @@ public class Scene_main_jiekou :MonoBehaviour
return await withdrawAccountUpdate.WithdrawAccountUpdate(body);
}
public async Task<ForgingResponse> ForgingInfos()//¶ÍÔìÅäÖÃ
public async Task<ForgingResponse> ForgingInfos(int key)//¶ÍÔìÅäÖÃ
{
return await forgingConfig.ForgingInfo();
return await forgingConfig.ForgingInfo(key);
}
public async Task<myResponse> ForgingSumbits(int id)//¶ÍÔìÌá½»
@ -401,8 +401,8 @@ public class Scene_main_jiekou :MonoBehaviour
return await treeachievement.Treeachievement();
}
public async Task<ForgingdatalistResponse> ForgingdatalistInfos()
public async Task<ForgingdatalistResponse> ForgingdatalistInfos(int key)
{
return await forgingdatalist.ForgingdatalistInfo();
return await forgingdatalist.ForgingdatalistInfo(key);
}
}

View File

@ -17,6 +17,8 @@ public class FrogeItem : MonoBehaviour
public Sprite gold;
public Sprite gem;
public scenefroge scenefroge;
void Start()
{
buyBtn.onClick.AddListener(buyClick);
@ -27,6 +29,7 @@ public class FrogeItem : MonoBehaviour
myResponse response = await Scene_main_jiekou.instance.ForgingSumbits(id);
if (response.code == 200)
{
scenefroge.updataitem();
Promptmgr.Instance.PromptBubble(response.message);
}
else

View File

@ -15,30 +15,44 @@ public class scenefroge : MonoBehaviour
public Transform Connact;
List<GameObject> forginglist =new List<GameObject>();
private async void OnEnable()
{
ForgingResponse forging = await Scene_main_jiekou.instance.ForgingInfos();
for (int i = 0; i < forginglist.Count; i++)
updataitem();
}
public async void updataitem()
{
foreach (GameObject obj in forginglist)
{
forginglist[i].GetComponent<FrogeItem>().icon = forging.Data[i].Icon;
forginglist[i].GetComponent<FrogeItem>().id =forging.Data[i].Id;
forginglist[i].GetComponent<FrogeItem>().name.text = forging.Data[i].Name;
forginglist[i].GetComponent<FrogeItem>().yield_cycle.text = forging.Data[i].yield_cycle.ToString();
forginglist[i].GetComponent<FrogeItem>().price.text =forging.Data[i].Price.ToString();
if (forging.Data[i].price_type == 1)
{
forginglist[i].GetComponent<FrogeItem>().price_type.sprite = forginglist[i].GetComponent<FrogeItem>().gem;
}
else
{
forginglist[i].GetComponent<FrogeItem>().price_type.sprite = forginglist[i].GetComponent<FrogeItem>().gold;
}
Destroy(obj);
}
forginglist.Clear();
ForgingdatalistResponse info = await Scene_main_jiekou.instance.ForgingdatalistInfos(1);
for (int j = 0; j < info.data.Length; j++)
{
GameObject obj = Instantiate(forgingConnctitem, GemConnact);
forginglist.Add(obj);
obj.GetComponent<forgingConnctitem>().name.text = info.data[j].config_name;
obj.GetComponent<forgingConnctitem>().RemainingOutput.text = info.data[j].surplus_yield.ToString();
obj.GetComponent<forgingConnctitem>().RemainingTime.text = info.data[j].surplus_count.ToString();
}
ForgingdatalistResponse infos = await Scene_main_jiekou.instance.ForgingdatalistInfos(2);
for (int j = 0; j < infos.data.Length; j++)
{
GameObject obj = Instantiate(forgingConnctitem, CoinConnact);
forginglist.Add(obj);
obj.GetComponent<forgingConnctitem>().name.text = infos.data[j].config_name;
obj.GetComponent<forgingConnctitem>().RemainingOutput.text = infos.data[j].surplus_yield.ToString();
obj.GetComponent<forgingConnctitem>().RemainingTime.text = infos.data[j].surplus_count.ToString();
}
}
async void Start()
{
ForgingResponse forging = await Scene_main_jiekou.instance.ForgingInfos();
ForgingResponse forging = await Scene_main_jiekou.instance.ForgingInfos(1);
for (int i = 0; i < forging.Data.Count; i++)
{
GameObject obj = Instantiate(forgingItem, Connact);
@ -47,18 +61,27 @@ public class scenefroge : MonoBehaviour
obj.GetComponent<FrogeItem>().name.text = forging.Data[i].Name;
obj.GetComponent<FrogeItem>().yield_cycle.text = forging.Data[i].yield_cycle.ToString();
obj.GetComponent<FrogeItem>().price.text = forging.Data[i].Price.ToString();
if (forging.Data[i].price_type == 1)
{
obj.GetComponent<FrogeItem>().price_type.sprite = obj.GetComponent<FrogeItem>().gem;
}
else
{
obj.GetComponent<FrogeItem>().price_type.sprite = obj.GetComponent<FrogeItem>().gold;
}
obj.GetComponent<FrogeItem>().scenefroge = this;
obj.GetComponent<FrogeItem>().price_type.sprite = obj.GetComponent<FrogeItem>().gem;
}
ForgingResponse forgings = await Scene_main_jiekou.instance.ForgingInfos(2);
for (int i = 0; i < forging.Data.Count; i++)
{
GameObject obj = Instantiate(forgingItem, Connact);
obj.GetComponent<FrogeItem>().icon = forgings.Data[i].Icon;
obj.GetComponent<FrogeItem>().id = forgings.Data[i].Id;
obj.GetComponent<FrogeItem>().name.text = forgings.Data[i].Name;
obj.GetComponent<FrogeItem>().yield_cycle.text = forgings.Data[i].yield_cycle.ToString();
obj.GetComponent<FrogeItem>().price.text = forgings.Data[i].Price.ToString();
obj.GetComponent<FrogeItem>().scenefroge = this;
obj.GetComponent<FrogeItem>().price_type.sprite = obj.GetComponent<FrogeItem>().gold;
}
}
private void OnDisable()
{
}

View File

@ -21,14 +21,12 @@ public class ForgingConfig : MonoBehaviour
{ "client-info", "{\"platform\":\"ios\",\"phone_product\":\"apple\",\"phone_model\":\"iPhone_8\",\"system_version\":\"12.0\",\"screen_size\":\"750*1334\",\"device_no\":\"e3e277810fff9d955ebdd7037eff51a8\",\"version\":\"1.0.0\"}" }
};
}
public async Task<ForgingResponse> ForgingInfo()
public async Task<ForgingResponse> ForgingInfo(int key)
{
string response = await myWeb.SendRequest(myWeb.URL + "/api/forge_maker/config", "GET", "{}", CreateHeaders());
string response = await myWeb.SendRequest(myWeb.URL + "/api/forge_maker/config?type="+key, "GET", "{}", CreateHeaders());
Debug.Log("ÌáÏּǼ" + response);
ForgingResponse ForgingResponse = JsonConvert.DeserializeObject<ForgingResponse>(response);
Debug.Log(ForgingResponse.Data[0].Id);
return ForgingResponse;
}
}

View File

@ -20,9 +20,9 @@ public class Forgingdatalist : MonoBehaviour
{ "client-info", "{\"platform\":\"ios\",\"phone_product\":\"apple\",\"phone_model\":\"iPhone_8\",\"system_version\":\"12.0\",\"screen_size\":\"750*1334\",\"device_no\":\"e3e277810fff9d955ebdd7037eff51a8\",\"version\":\"1.0.0\"}" }
};
}
public async Task<ForgingdatalistResponse> ForgingdatalistInfo()
public async Task<ForgingdatalistResponse> ForgingdatalistInfo(int key)
{
string response = await myWeb.SendRequest(myWeb.URL + "/api/forge_maker/data_list", "GET", "{}", CreateHeaders());
string response = await myWeb.SendRequest(myWeb.URL + "/api/forge_maker/data_list?type="+key, "GET", "{}", CreateHeaders());
Debug.Log("ÌáÏּǼ" + response);
ForgingdatalistResponse Forgingdatalistresponse = JsonConvert.DeserializeObject<ForgingdatalistResponse>(response);
return Forgingdatalistresponse;
@ -39,7 +39,7 @@ public class ForgingdatalistData
public string config_icon;
public int config_type;
public int surplus_count;
public int surplus_yield;
public float surplus_yield;
}
[System.Serializable]