コード例 #1
0
    private bool ShowInitFaildPanel(string text)
    {
        if (!initFaildPanelIsShown)
        {
            initFaildPanelIsShown = true;
            //这里还得用这个方法实现,因为在UIManager初始化之前有一步拷贝配置文件的过程,如果发生意外,这里用UIManager就会有问题
            //这个路径就强制不能变了吧
            Object     prefab      = Resources.Load <Object>(@"objects/ui/common_ngui/uipnlinitiatefailed");
            GameObject failedPanel = Instantiate(prefab) as GameObject;
            failedPanel.transform.localPosition = Vector3.zero;
            float a = 1, b = 320, c = a / b;
            failedPanel.transform.localScale = new Vector3(c, c, c);

            var obj = UiUtility.FindChild(failedPanel, "Text");
#if UNITY_EDITOR
            if (!requestManagerSuccess)
            {
                obj.GetComponent <UILabel>().text = "CLientHelper模块初始化失败,找服务器去";
            }
            else
            {
                obj.GetComponent <UILabel>().text  = "自己看日志, 如果文件被占用就重启unity  ; ";
                obj.GetComponent <UILabel>().text += UnpackFile2PersistentPath.UnPackFileError;
            }
#else
#endif

            return(false);
        }

        return(true);
    }