浇水接口与生态树界面信息的接入
This commit is contained in:
parent
0db2e858d0
commit
4fcaadbddb
@ -23369,17 +23369,6 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: fe389f164964bb5439a3af9dd99f368b, type: 3}
|
m_Script: {fileID: 11500000, guid: fe389f164964bb5439a3af9dd99f368b, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
chart_title: {fileID: 1130338437}
|
|
||||||
stats1award: {fileID: 1505730914}
|
|
||||||
stats1Name: {fileID: 1652979243}
|
|
||||||
stats2award: {fileID: 1891318826}
|
|
||||||
stats2Name: {fileID: 2034784578}
|
|
||||||
stats3award: {fileID: 2061927514}
|
|
||||||
stats3Name: {fileID: 1228408899}
|
|
||||||
stats4award: {fileID: 2042099569}
|
|
||||||
stats4Name: {fileID: 1294981208}
|
|
||||||
stats5award: {fileID: 1340421628}
|
|
||||||
stats5Name: {fileID: 1912126104}
|
|
||||||
--- !u!1001 &307054139
|
--- !u!1001 &307054139
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -38961,6 +38950,14 @@ PrefabInstance:
|
|||||||
propertyPath: m_IsActive
|
propertyPath: m_IsActive
|
||||||
value: 1
|
value: 1
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1477323885512014905, guid: aa401e2ce6d8c5847a9a32a4ac92f0f0, type: 3}
|
||||||
|
propertyPath: m_Type
|
||||||
|
value: 3
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1477323885512014905, guid: aa401e2ce6d8c5847a9a32a4ac92f0f0, type: 3}
|
||||||
|
propertyPath: m_FillAmount
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 1477323885563993957, guid: aa401e2ce6d8c5847a9a32a4ac92f0f0, type: 3}
|
- target: {fileID: 1477323885563993957, guid: aa401e2ce6d8c5847a9a32a4ac92f0f0, type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
value: 1
|
value: 1
|
||||||
@ -39029,6 +39026,10 @@ PrefabInstance:
|
|||||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
|
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
|
||||||
value: UnityEngine.Object, UnityEngine
|
value: UnityEngine.Object, UnityEngine
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1477323885912149536, guid: aa401e2ce6d8c5847a9a32a4ac92f0f0, type: 3}
|
||||||
|
propertyPath: m_Name
|
||||||
|
value: LevelText
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 1477323885963982138, guid: aa401e2ce6d8c5847a9a32a4ac92f0f0, type: 3}
|
- target: {fileID: 1477323885963982138, guid: aa401e2ce6d8c5847a9a32a4ac92f0f0, type: 3}
|
||||||
propertyPath: m_SizeDelta.x
|
propertyPath: m_SizeDelta.x
|
||||||
value: 155
|
value: 155
|
||||||
@ -47566,7 +47567,20 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
waterCountText: {fileID: 1414549386}
|
waterCountText: {fileID: 1414549386}
|
||||||
waterCount: 1000
|
chart_title: {fileID: 1130338437}
|
||||||
|
stats1award: {fileID: 1505730914}
|
||||||
|
stats1Name: {fileID: 1652979243}
|
||||||
|
stats2award: {fileID: 1891318826}
|
||||||
|
stats2Name: {fileID: 2034784578}
|
||||||
|
stats3award: {fileID: 2061927514}
|
||||||
|
stats3Name: {fileID: 1228408899}
|
||||||
|
stats4award: {fileID: 2042099569}
|
||||||
|
stats4Name: {fileID: 1294981208}
|
||||||
|
stats5award: {fileID: 1340421628}
|
||||||
|
stats5Name: {fileID: 1912126104}
|
||||||
|
TreeLevel: {fileID: 1425098712}
|
||||||
|
LevelShow: {fileID: 1242654122}
|
||||||
|
TreeExpFill: {fileID: 1600949661}
|
||||||
--- !u!1 &622223219
|
--- !u!1 &622223219
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -91347,6 +91361,17 @@ CanvasRenderer:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1239001328}
|
m_GameObject: {fileID: 1239001328}
|
||||||
m_CullTransparentMesh: 1
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!114 &1242654122 stripped
|
||||||
|
MonoBehaviour:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 1477323885369638739, guid: aa401e2ce6d8c5847a9a32a4ac92f0f0, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 509057630}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!1 &1244641367
|
--- !u!1 &1244641367
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -102874,6 +102899,17 @@ RectTransform:
|
|||||||
m_AnchoredPosition: {x: 0, y: -24.21}
|
m_AnchoredPosition: {x: 0, y: -24.21}
|
||||||
m_SizeDelta: {x: 100, y: 100}
|
m_SizeDelta: {x: 100, y: 100}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!114 &1425098712 stripped
|
||||||
|
MonoBehaviour:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 1477323885912149566, guid: aa401e2ce6d8c5847a9a32a4ac92f0f0, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 509057630}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!1 &1426505138
|
--- !u!1 &1426505138
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -113587,7 +113623,7 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6931136036260294082, guid: e80ddc32e04c4a44eaeabc0e8937a298, type: 3}
|
- target: {fileID: 6931136036260294082, guid: e80ddc32e04c4a44eaeabc0e8937a298, type: 3}
|
||||||
propertyPath: m_IsActive
|
propertyPath: m_IsActive
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6931136036260294093, guid: e80ddc32e04c4a44eaeabc0e8937a298, type: 3}
|
- target: {fileID: 6931136036260294093, guid: e80ddc32e04c4a44eaeabc0e8937a298, type: 3}
|
||||||
propertyPath: m_Pivot.x
|
propertyPath: m_Pivot.x
|
||||||
@ -113955,7 +113991,7 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6931136037450377240, guid: e80ddc32e04c4a44eaeabc0e8937a298, type: 3}
|
- target: {fileID: 6931136037450377240, guid: e80ddc32e04c4a44eaeabc0e8937a298, type: 3}
|
||||||
propertyPath: m_SizeDelta.y
|
propertyPath: m_SizeDelta.y
|
||||||
value: 0
|
value: -723.68835
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6931136037576709270, guid: e80ddc32e04c4a44eaeabc0e8937a298, type: 3}
|
- target: {fileID: 6931136037576709270, guid: e80ddc32e04c4a44eaeabc0e8937a298, type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
@ -117872,6 +117908,17 @@ CanvasRenderer:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1600763613}
|
m_GameObject: {fileID: 1600763613}
|
||||||
m_CullTransparentMesh: 1
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!114 &1600949661 stripped
|
||||||
|
MonoBehaviour:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 1477323885512014905, guid: aa401e2ce6d8c5847a9a32a4ac92f0f0, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 509057630}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!1 &1601098542
|
--- !u!1 &1601098542
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -156800,6 +156847,24 @@ CanvasRenderer:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 2116513763}
|
m_GameObject: {fileID: 2116513763}
|
||||||
m_CullTransparentMesh: 1
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!1 &2119209698 stripped
|
||||||
|
GameObject:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 1477323884977120185, guid: aa401e2ce6d8c5847a9a32a4ac92f0f0, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 509057630}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
--- !u!114 &2119209703
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2119209698}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 8c0010ce7d06b5b49bc0c14891f46648, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
wateringBtn: {fileID: 0}
|
||||||
--- !u!1 &2119903091
|
--- !u!1 &2119903091
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -7,33 +7,11 @@ using Unity.VisualScripting;
|
|||||||
|
|
||||||
public class FramePanel : MonoBehaviour
|
public class FramePanel : MonoBehaviour
|
||||||
{
|
{
|
||||||
public Text chart_title;
|
|
||||||
|
|
||||||
public Text stats1award;
|
|
||||||
public Text stats1Name;
|
|
||||||
public Text stats2award;
|
|
||||||
public Text stats2Name;
|
|
||||||
public Text stats3award;
|
|
||||||
public Text stats3Name;
|
|
||||||
public Text stats4award;
|
|
||||||
public Text stats4Name;
|
|
||||||
public Text stats5award;
|
|
||||||
public Text stats5Name;
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
async void Start()
|
async void Start()
|
||||||
{
|
{
|
||||||
TreeInfo info = await Scene_main_jiekou.instance.TreeInfoS();
|
|
||||||
chart_title.text = info.Data.ChartTitle;
|
|
||||||
stats1award.text = info.Data.Charts[0].Reward;
|
|
||||||
stats1Name.text = info.Data.Charts[0].Name;
|
|
||||||
stats2award.text = info.Data.Charts[1].Reward;
|
|
||||||
stats2Name.text = info.Data.Charts[1].Name;
|
|
||||||
stats3award.text = info.Data.Charts[2].Reward;
|
|
||||||
stats3Name.text = info.Data.Charts[2].Name;
|
|
||||||
stats4award.text = info.Data.Charts[3].Reward;
|
|
||||||
stats4Name.text = info.Data.Charts[3].Name;
|
|
||||||
stats5award.text = info.Data.Charts[4].Reward;
|
|
||||||
stats5Name.text = info.Data.Charts[4].Name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,13 +20,13 @@ public class TreeFunctionPanel : MonoBehaviour
|
|||||||
private void OnClickFeedBtn()
|
private void OnClickFeedBtn()
|
||||||
{
|
{
|
||||||
//点击喂养按钮扣水分
|
//点击喂养按钮扣水分
|
||||||
WaterPanel.instance.setWater(-100);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnClickWateringBtn()
|
private void OnClickWateringBtn()
|
||||||
{
|
{
|
||||||
//浇水按钮扣水分
|
//浇水按钮扣水分
|
||||||
WaterPanel.instance.setWater(-50);
|
//WaterPanel.instance.setWater(-50);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
|
@ -7,36 +7,52 @@ public class WaterPanel : MonoBehaviour
|
|||||||
{
|
{
|
||||||
public static WaterPanel instance;
|
public static WaterPanel instance;
|
||||||
public Text waterCountText;
|
public Text waterCountText;
|
||||||
public int waterCount = 1000;
|
|
||||||
|
|
||||||
|
public Text chart_title;
|
||||||
|
|
||||||
|
public Text stats1award;
|
||||||
|
public Text stats1Name;
|
||||||
|
public Text stats2award;
|
||||||
|
public Text stats2Name;
|
||||||
|
public Text stats3award;
|
||||||
|
public Text stats3Name;
|
||||||
|
public Text stats4award;
|
||||||
|
public Text stats4Name;
|
||||||
|
public Text stats5award;
|
||||||
|
public Text stats5Name;
|
||||||
|
|
||||||
|
public Text TreeLevel;
|
||||||
|
public Text LevelShow;
|
||||||
|
public Image TreeExpFill;
|
||||||
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
async void Start()
|
||||||
{
|
{
|
||||||
instance = this;
|
instance = this;
|
||||||
waterCountText.text = waterCount.ToString() + "g";
|
TreeInfo info = await Scene_main_jiekou.instance.TreeInfoS();
|
||||||
|
Updated_interface(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setWater(int wa)
|
public void Updated_interface(TreeInfo info)
|
||||||
{
|
{
|
||||||
//得到水分
|
chart_title.text = info.Data.ChartTitle;
|
||||||
if(wa > 0)
|
stats1award.text = info.Data.Charts[0].Reward;
|
||||||
{
|
stats1Name.text = info.Data.Charts[0].Name;
|
||||||
waterCount += wa;
|
stats2award.text = info.Data.Charts[1].Reward;
|
||||||
}
|
stats2Name.text = info.Data.Charts[1].Name;
|
||||||
//扣水
|
stats3award.text = info.Data.Charts[2].Reward;
|
||||||
else
|
stats3Name.text = info.Data.Charts[2].Name;
|
||||||
{
|
stats4award.text = info.Data.Charts[3].Reward;
|
||||||
int count = waterCount + wa;//-998
|
stats4Name.text = info.Data.Charts[3].Name;
|
||||||
if (count < 0)
|
stats5award.text = info.Data.Charts[4].Reward;
|
||||||
{
|
stats5Name.text = info.Data.Charts[4].Name;
|
||||||
Debug.Log("水分不够,请充值!");
|
|
||||||
}
|
Debug.Log(info.Data.upgrade_exp);
|
||||||
else
|
waterCountText.text = info.Data.Water.ToString();
|
||||||
{
|
TreeLevel.text = "Éú̬Ê÷µÈ¼¶Lv." + info.Data.Level;
|
||||||
waterCount =count;
|
LevelShow.text = info.Data.Exp + "/" + info.Data.upgrade_exp;
|
||||||
}
|
TreeExpFill.fillAmount = info.Data.Exp / info.Data.upgrade_exp;
|
||||||
}
|
|
||||||
waterCountText.text = waterCount.ToString() + "g";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,15 +13,7 @@ public class Lottery : MonoBehaviour
|
|||||||
|
|
||||||
void LotteryClick()
|
void LotteryClick()
|
||||||
{
|
{
|
||||||
if ((WaterPanel.instance.waterCount-999) > 0)
|
|
||||||
{
|
|
||||||
WaterPanel.instance.setWater(-999);
|
|
||||||
LotteryPanel.gameObject.SetActive(true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Promptmgr.Instance.PromptBubble("水量不足,无法抽奖");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
|
35
meng_yao/Assets/script/scene_Main/WateringBtn.cs
Normal file
35
meng_yao/Assets/script/scene_Main/WateringBtn.cs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public class WateringBtn : MonoBehaviour
|
||||||
|
{
|
||||||
|
public Button wateringBtn;
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
wateringBtn = GetComponent<Button>();
|
||||||
|
wateringBtn.onClick.AddListener(WateringClick);
|
||||||
|
}
|
||||||
|
|
||||||
|
async void WateringClick()
|
||||||
|
{
|
||||||
|
WateringTreeResponse response = await Scene_main_jiekou.instance.WateringTrees();
|
||||||
|
if (response.code == 200)
|
||||||
|
{
|
||||||
|
Debug.Log("½½Ë®³É¹¦");
|
||||||
|
TreeInfo info = await Scene_main_jiekou.instance.TreeInfoS();
|
||||||
|
WaterPanel.instance. Updated_interface(info);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Promptmgr.Instance.PromptBubble(response.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
11
meng_yao/Assets/script/scene_Main/WateringBtn.cs.meta
Normal file
11
meng_yao/Assets/script/scene_Main/WateringBtn.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8c0010ce7d06b5b49bc0c14891f46648
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -41,7 +41,7 @@ public class TreeInfoData
|
|||||||
public float Water { get; set; }
|
public float Water { get; set; }
|
||||||
public int Level { get; set; }
|
public int Level { get; set; }
|
||||||
public int Exp { get; set; }
|
public int Exp { get; set; }
|
||||||
public int UpgradeExp { get; set; }
|
public int upgrade_exp { get; set; }
|
||||||
public List<TreeInfoReward> Rewards { get; set; }
|
public List<TreeInfoReward> Rewards { get; set; }
|
||||||
public string ChartTitle { get; set; }
|
public string ChartTitle { get; set; }
|
||||||
public List<TreeInfoChart> Charts { get; set; }
|
public List<TreeInfoChart> Charts { get; set; }
|
||||||
|
@ -26,7 +26,7 @@ public class wateringTree : MonoBehaviour
|
|||||||
Debug.Log("生态树浇水" + response);
|
Debug.Log("生态树浇水" + response);
|
||||||
//bbbb
|
//bbbb
|
||||||
WateringTreeResponse wateringTreeResponse = JsonConvert.DeserializeObject<WateringTreeResponse>(response);
|
WateringTreeResponse wateringTreeResponse = JsonConvert.DeserializeObject<WateringTreeResponse>(response);
|
||||||
Debug.Log("=========" + wateringTreeResponse.Data.upgraded);
|
// Debug.Log("=========" + wateringTreeResponse.Data.upgraded);
|
||||||
return wateringTreeResponse;
|
return wateringTreeResponse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user