2024-12-18 17:06:59 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
public class WateringBtn : MonoBehaviour
|
|
|
|
|
{
|
2024-12-18 23:39:18 +08:00
|
|
|
|
Button wateringBtn;
|
2024-12-18 17:06:59 +08:00
|
|
|
|
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("<22><>ˮ<EFBFBD>ɹ<EFBFBD>");
|
|
|
|
|
TreeInfo info = await Scene_main_jiekou.instance.TreeInfoS();
|
|
|
|
|
WaterPanel.instance. Updated_interface(info);
|
2024-12-18 23:39:18 +08:00
|
|
|
|
WaterPanel.instance.Updated_water(info);
|
2024-12-18 17:06:59 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Promptmgr.Instance.PromptBubble(response.message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// Update is called once per frame
|
|
|
|
|
void Update()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|