wangguan
2020-12-26 e371272a7885723c7b0ef31a20ae5d0fbead1d30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using UnityEngine;
using UnityEngine.UI;
 
public class FavoritePanelUI : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        transform.Find("YesBtn").GetComponent<Button>().onClick.AddListener(OnClickYesBtn);
        transform.Find("NoBtn").GetComponent<Button>().onClick.AddListener(OnClickNoBtn);
 
    }
 
    private Action myAC;
    public void SetAC(Action ac)
    {
        myAC = ac;
    }
 
    private void OnClickYesBtn()
    {
        TDAA_SDKManager.Ins.OnClickPVPBtn();
        Close();
    }
    private void OnClickNoBtn()
    {
        Close();
    }
 
    private void Close()
    {
        PlayerPrefs.SetInt("GemBattleFavorite", 1);
        if(myAC!=null){
            myAC();
        }
        Destroy(gameObject);
    }
 
 
 
}