Ejemplo n.º 1
0
        private static IEnumerator LoadMessageBox()
        {
            var req = ResourcesLoader.LoadAssetCoroutine(CUtils.GetRightFileName(MESSAGEBOX_ABNAME), CUtils.GetAssetName(MESSAGEBOX_ABNAME), typeof(GameObject), int.MaxValue);

            yield return(req);

            var obj    = req.GetAsset <GameObject>();
            var ins    = GameObject.Instantiate(obj);
            var msgbox = ins.GetComponent <MessageBox>();

            SetContent(msgbox, m_messageBoxInfo);
        }
Ejemplo n.º 2
0
        private static IEnumerator LoadMessageBox()
        {
            var req = ResourcesLoader.LoadAssetCoroutine(CUtils.GetRightFileName(MESSAGEBOX_ABNAME), CUtils.GetAssetName(MESSAGEBOX_ABNAME), typeof(GameObject), int.MaxValue);

            yield return(req);

            var obj = req.GetAsset <GameObject> ();
            var ins = GameObject.Instantiate(obj);

            m_messageBox = ins.GetComponent <MessageBox> ();
            m_isloading  = false;
            DontDestroyOnLoad(ins);
            m_messageBox.ShowContent(m_messageBoxInfo.text, m_messageBoxInfo.caption, m_messageBoxInfo.btns);
        }
Ejemplo n.º 3
0
        private static IEnumerator LoadMessageBox(MessageBoxInfo m_messageBoxInfo)
        {
#if MESSAGEBOX_DEBUG
            Debug.LogFormat("LoadMessageBox .LoadAssetCoroutine {0} ,frame={1}  ", m_messageBoxInfo, Time.frameCount);
#endif
            var req = ResourcesLoader.LoadAssetCoroutine(CUtils.GetRightFileName(MESSAGEBOX_ABNAME), CUtils.GetAssetName(MESSAGEBOX_ABNAME), typeof(GameObject), int.MaxValue);
            yield return(req);

#if MESSAGEBOX_DEBUG
            Debug.LogFormat("LoadMessageBox LoadAssetCoroutine is done {0},frame={1}  ", req, Time.frameCount);
#endif
            var obj = (GameObject)req.data;
#if MESSAGEBOX_DEBUG
            Debug.LogFormat("LoadMessageBox obj req.GetAsset<GameObject> {0} ,frame={1}  ", obj, Time.frameCount);
#endif
            var ins = GameObject.Instantiate(obj);
            m_messageBox = ins.GetComponent <MessageBox> ();
            m_isloading  = false;
            DontDestroyOnLoad(ins);
            m_messageBox.ShowContent(m_messageBoxInfo.text, m_messageBoxInfo.caption, m_messageBoxInfo.btns);
        }