public static ConfirmYesNoInterface AskCustom(string title, string interfaceName, params string[] labels) { ConfirmYesNoInterface confirm = (ConfirmYesNoInterface)menuMan.Load("Interface_ConfirmYesNo"); confirm._promise = new Promise <string>(); confirm.labelTitle.text = title; confirm.labelConfirm.gameObject.SetActive(false); confirm.CreateButtonsFromLabels(labels); GameObject prefab = Resources.Load <GameObject>("Interfaces/" + interfaceName); GameObject custom = Instantiate <GameObject>(prefab); custom.transform.SetParent(confirm.CustomArea); custom.transform.localScale = Vector2.one; custom.transform.localPosition = Vector2.zero; TMP_InputField input = custom.GetComponentInChildren <TMP_InputField>(); if (input != null) { input.Select(); input.ActivateInputField(); } return(confirm); }
/////////////////////////////////////////////////////////// public static ConfirmYesNoInterface Ask(string title, string confirmMsg, params string[] labels) { ConfirmYesNoInterface confirm = (ConfirmYesNoInterface)menuMan.Load("Interface_ConfirmYesNo"); confirm._promise = new Promise <string>(); confirm.labelTitle.text = title; confirm.labelConfirm.text = confirmMsg; confirm.CreateButtonsFromLabels(labels); return(confirm); }