Exemplo n.º 1
0
    //public static GameObject QaController;
    private void Awake()
    {
        //#if UNITY_EDITOR
        //        LinkStart.message = "JGCY_GX";
        //        PublicClass.filePath = Application.persistentDataPath + "/";
        //#endif
        if (GlobalVariable.practiceState == PracticeState.classes || GlobalVariable.practiceState == PracticeState.errors)
        {
            Debug.Log("GlobalVariable.practiceState :" + GlobalVariable.practiceState);
            currentQaPath = PublicClass.filePath;
            return;
        }
        Debug.Log("BanckScript: " + JsonConvert.SerializeObject(PublicClass.app));
        string basePath = AppOpera.QA_path;

        currentQaPath = basePath + PublicClass.app.app_id + "_" + PublicClass.app.app_version;
        if (Directory.Exists(currentQaPath))
        {
            currentQaPath = Vesal_DirFiles.findFileInPath(currentQaPath, PublicClass.app.struct_code + ".xml");
        }
        else
        {
            StartCoroutine(transform.GetComponent <StartPanel>().requestFailed("资源获取失败,请返回重试!"));
        }


        //if (!File.Exists(currentQaPath + PublicClass.app.struct_code + ".xml"))
        //{
        //    Debug.Log("BanckScript: " + currentQaPath + PublicClass.app.struct_code + ".xml");

        //    Debug.Log("BanckScript:  不存在xml,解压文件夹。");
        //    //pass
        //    string firstDirName = string.Empty;
        //    Vesal_DirFiles.ExtractAppData(ref basePath, ref firstDirName);
        //    if (File.Exists(currentQaPath + PublicClass.app.struct_code + ".xml"))
        //    {
        //        //pass
        //    }
        //    else if (File.Exists(currentQaPath + firstDirName + "/" + PublicClass.app.struct_code + ".xml"))
        //    {
        //        currentQaPath = currentQaPath + firstDirName + "/";
        //    }
        //    else
        //    {

        //        StartCoroutine(transform.GetComponent<StartPanel>().requestFailed("资源获取失败,请返回重试!"));
        //    }
        //    Debug.Log(firstDirName);
        //}
        GlobalVariable.bankName = PublicClass.app.struct_code;
        Debug.Log(currentQaPath);
        Debug.Log(GlobalVariable.bankName);
    }