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 UnityAction onReject; 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.Find("Frame/BtnReject").GetComponent