Cute_demon_attacks/meng_yao/Assets/script/scene_Main/WateringBtn.cs

37 lines
884 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class WateringBtn : MonoBehaviour
{
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);
WaterPanel.instance.Updated_water(info);
}
else
{
Promptmgr.Instance.PromptBubble(response.message);
}
}
// Update is called once per frame
void Update()
{
}
}