过程版本存档
This commit is contained in:
+55
@@ -0,0 +1,55 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.EventSystems;
|
||||
namespace RainbowArt.CleanFlatUI
|
||||
{
|
||||
public class NotificationContentFitterWithButtonUI : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
Button button;
|
||||
|
||||
[SerializeField]
|
||||
NotificationContentFitterWithButton notification;
|
||||
|
||||
void Start()
|
||||
{
|
||||
notification.gameObject.SetActive(false);
|
||||
button.onClick.AddListener(OnButtonClick);
|
||||
}
|
||||
|
||||
void OnButtonClick()
|
||||
{
|
||||
notification.OnFirst.RemoveAllListeners();
|
||||
notification.OnFirst.AddListener(NotificationFirst);
|
||||
notification.OnSecond.RemoveAllListeners();
|
||||
notification.OnSecond.AddListener(NotificationSecond);
|
||||
notification.OnThird.RemoveAllListeners();
|
||||
notification.OnThird.AddListener(NotificationThird);
|
||||
notification.OnCancel.RemoveAllListeners();
|
||||
notification.OnCancel.AddListener(NotificationCancel);
|
||||
notification.ShowNotification();
|
||||
}
|
||||
|
||||
void NotificationFirst()
|
||||
{
|
||||
Debug.Log("First Button Clicked");
|
||||
}
|
||||
|
||||
void NotificationSecond()
|
||||
{
|
||||
Debug.Log("Second Button Clicked");
|
||||
}
|
||||
|
||||
void NotificationThird()
|
||||
{
|
||||
Debug.Log("Third Button Clicked");
|
||||
}
|
||||
|
||||
void NotificationCancel()
|
||||
{
|
||||
Debug.Log("Cancel Button Clicked");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user