using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.Events; public class ModalView : MonoBehaviour { public string text; public string textKey; public object[] textFormatArgs = {}; public UnityAction onAgree; public string onAgreeTextKey; public UnityAction onReject; public string onRejectTextKey; public bool willDestroyAfterClick = true; public static ModalView Show() { GameObject o = GameObject.Instantiate(Resources.Load("Prefabs/Views/ModalView")); ModalView v = o.AddComponent(); return v; } void Start() { if (textKey != null) { TextAutoLanguage2 t2 = transform.Find("Frame/Text").gameObject.AddComponent(); t2.textFormatArgs = textFormatArgs; t2.SetTextKey(textKey); } else { transform.Find("Frame/Text").GetComponent().text = text; } Transform btnReject = transform.Find("Frame/BtnReject"); btnReject.GetComponent