_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/Scene_main/main_kuangchang.cs

27 lines
650 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class main_kuangchang :main_shop
{
[Header("跳转按钮")]
public Button JumpBtn;
[Header("跳转场景的编号")]
public int SceneIndex;
public override void Start()
{
JumpBtn.onClick.AddListener(() => asyncOnShopBTN(JumpBtn,SceneIndex));
}
public async void asyncOnShopBTN(Button BTN, int index)
{
await ButtonClickAnimationAsync(BTN.gameObject);
BTN.transform.GetComponent<main_RedDot>().HideRedDot();
SceneManager.LoadScene(index);
}
}