public static CCommonPopup Make(string title, string contents, string btn1 = "Ok", string btn2 = "", string btn3 = "") { CCommonPopup.Config config = new CCommonPopup.Config(); config.items ["title"] = title; config.items ["contents"] = contents; config.items ["btn1"] = btn1; config.items ["btn2"] = btn2; config.items ["btn3"] = btn3; return(Make(config)); }
public static CCommonPopup Make(CCommonPopup.Config config) { var prefab = Resources.Load(config.prefab); if (prefab == null) { Debug.unityLogger.LogError( System.Reflection.MethodBase.GetCurrentMethod().Name, string.Format("cannot find prefab('{0}')", config.prefab)); return(null); } var inst = UnityEditor.PrefabUtility.InstantiatePrefab(prefab) as GameObject; var popup = CModal.Make <CCommonPopup> (inst.transform); popup.SetConfig(config); return(popup); }