36 lines
890 B
C#
36 lines
890 B
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
public class PetFightingBtn : MonoBehaviour
|
|||
|
{
|
|||
|
Button figntBtn;
|
|||
|
public int id;
|
|||
|
void Start()
|
|||
|
{
|
|||
|
figntBtn = GetComponent<Button>();
|
|||
|
figntBtn.onClick.AddListener(fightClick);
|
|||
|
}
|
|||
|
|
|||
|
async void fightClick()
|
|||
|
{
|
|||
|
bool issuccefful = await Scene_main_jiekou.instance.PetBettless(id);
|
|||
|
if (issuccefful)
|
|||
|
{
|
|||
|
petBettleInfoResponse petinfo = await Scene_main_jiekou.instance.getPetBettleInfos();
|
|||
|
WaterPanel.instance.Updated_petinfo(petinfo);
|
|||
|
this.gameObject.SetActive(false);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
Promptmgr.Instance.PromptBubble("<22><>սʧ<D5BD><CAA7>");
|
|||
|
this.gameObject.SetActive(false);
|
|||
|
}
|
|||
|
}
|
|||
|
// Update is called once per frame
|
|||
|
void Update()
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
}
|