50 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			50 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C#
		
	
	
	
| using System;
 | |
| using System.Collections.Generic;
 | |
| using UnityEngine;
 | |
| using UnityEngine.UI;
 | |
| 
 | |
| public class MMOBtns : MonoBehaviour
 | |
| {
 | |
|     public Action DelClickRobux;
 | |
|     public Action DelClickSkin;
 | |
|     public Action DelInvited;
 | |
| 
 | |
|     [SerializeField] Button mBtnRobux;
 | |
|     [SerializeField] Button mBtnSkin;
 | |
|     [SerializeField] Button mBtnInvitationCode;
 | |
| 
 | |
|     private void Awake()
 | |
|     {
 | |
|         mBtnRobux.onClick.AddListener(OnClickRobux);
 | |
|         mBtnSkin.onClick.AddListener(OnClickSkin);
 | |
|         mBtnInvitationCode.onClick.AddListener(OnClickInvitationCode);
 | |
|     }
 | |
| 
 | |
|     public void Init()
 | |
|     {
 | |
|         mBtnRobux.gameObject.SetActive(MMOModule.Instance.IsAccessible);
 | |
|         mBtnSkin.gameObject.SetActive(MMOModule.Instance.IsAccessible);
 | |
|         mBtnInvitationCode.gameObject.SetActive(MMOModule.Instance.IsInvitable);
 | |
|     }
 | |
| 
 | |
|     private void OnClickRobux()
 | |
|     {
 | |
|         DelClickRobux?.Invoke();
 | |
|     }
 | |
| 
 | |
|     private void OnClickSkin()
 | |
|     {
 | |
|         DelClickSkin?.Invoke();
 | |
|     }
 | |
| 
 | |
|     private void OnClickInvitationCode()
 | |
|     {
 | |
|         MMOModule.Instance.PopVerifyInvitation(() =>
 | |
|         {
 | |
|             mBtnRobux.gameObject.SetActive(true);
 | |
|             mBtnSkin.gameObject.SetActive(true);
 | |
|             mBtnInvitationCode.gameObject.SetActive(false);
 | |
|             DelInvited?.Invoke();
 | |
|         });
 | |
|     }
 | |
| } |