예제 #1
0
        private void LoadAssetSuccessCallback(string uiFormAssetName, object uiFormAsset, float duration, object userData)
        {
            try
            {
                OpenUIFormInfo openUIFormInfo = (OpenUIFormInfo)userData;
                if (openUIFormInfo == null)
                {
                    throw new Exception("Open UI form info is invalid.");
                }

                m_UIFormsBeingLoaded.Remove(openUIFormInfo.SerialId);

                //设置界面组信息

                HUIForm uIForm = m_HUIForms[openUIFormInfo.UIType];

                uIForm.UILogic.UIGroup = GetUIGroupField(uIForm.UILogic.UIGroupHierarchy);

                //获取加载包附加列表
                UIPackage uIPackage = UIPackage.GetUIPackage(uiFormAsset, uIForm.UILogic.FormClass);

                uIForm.UIPackageName = uIPackage.name;

                //界面创建初始化
                uIForm.UILogic.OnInit();

                //界面功能实施
                uIForm.UILogic.OnImplement();

                //界面打开
                uIForm.UILogic.OnOpen();

                ReferencePool.Release(openUIFormInfo);
            }
            catch (Exception exception)
            {
                Log.Error(Utility.Text.Format("Create UI form Error {0}", exception.ToString()));
            }
        }