示例#1
0
    public static void InitStaticData()
    {
        int mem = SystemInfo.systemMemorySize;

#if UNITY_EDITOR
        //QualitySettings.currentLevel = QualityLevel.Fastest;
        //Quality = Run_Quality.POOL;
        QualitySettings.currentLevel = QualityLevel.Good;
        Quality = Run_Quality.GOOD;
#elif UNITY_STANDALONE_WIN
        if (mem <= 4400)
        {
            QualitySettings.currentLevel = QualityLevel.Fastest;
            Quality = Run_Quality.POOL;
        }
        else
        {
            QualitySettings.currentLevel = QualityLevel.Good;
            Quality = Run_Quality.GOOD;
        }
#elif UNITY_IOS
        if (mem <= 1100)
        {
            QualitySettings.currentLevel = QualityLevel.Fastest;
            Quality = Run_Quality.POOL;
        }
        else
        {
            QualitySettings.currentLevel = QualityLevel.Good;
            Quality = Run_Quality.GOOD;
        }
#elif UNITY_ANDROID
        if (mem <= 3300)
        {
            QualitySettings.currentLevel = QualityLevel.Fastest;
            Quality = Run_Quality.POOL;
        }
        else
        {
            QualitySettings.currentLevel = QualityLevel.Good;
            Quality = Run_Quality.GOOD;
        }
#else
#endif
        Debug.Log("Quality :" + Quality);
        cameraBackAxisPosition = Vector3.zero;
        cameraBackAxisRotation = Vector3.zero;
        currentState           = RunState.Loading;
        currentModle           = ModleChoose.MainModel;
        Difficult_Index        = 0;
        data_list_count        = 0;
        tableCount             = 15;
        filePath = Application.persistentDataPath + "/";
#if UNITY_EDITOR
        fileLocalStreamingPath = "file://" + Application.streamingAssetsPath + "/";
        filePath = Application.streamingAssetsPath + "/";
#elif UNITY_IOS
        fileLocalStreamingPath = "file://" + Application.dataPath + "/Raw/";
#elif UNITY_ANDROID
        fileLocalStreamingPath = "jar:file://" + Application.dataPath + "!/assets/";
#elif UNITY_STANDALONE_WIN
        fileLocalStreamingPath = Application.streamingAssetsPath + "/";
        filePath = Application.persistentDataPath.Substring(0, Application.persistentDataPath.LastIndexOf("AppData") + 7) + "/roaming/Vesal_unity_PC/";
        Debug.Log("UNITY_STANDALONE_WIN filePath:" + filePath);
#endif
        tempPath = filePath + "temp/";
        Vesal_DirFiles.DelFile(tempPath + "temp.dat");
        vesal_db_path     = filePath + "db/";
        sign_texture_path = filePath + "sign_texture/";
        UpdatePath        = filePath + "Update/";
        SignPath          = filePath + "Android_sign/";
        ModelPath         = filePath + "model/";
        MedicalPath       = filePath + "Mediacl/";
        xluaPath          = filePath + "Lua-HotFix/";
        TimelineFilePath  = filePath + "Anim_Timeline/";
        WeiKePlayer_path  = filePath + "microlesson/";
        Video_path        = filePath + "acu_vdo/";
        Anim_TimelinePath = filePath + "Anim_Timeline/";
        BookMarkPath      = filePath + "BookmarkFile/";
        if (Quality == Run_Quality.GOOD)
        {
            MAX_Ab_num = 15;
        }
        else
        {
            MAX_Ab_num = 10;
        }

        //get_server_interface = "http://api.vesal.cn:8000/vesal-jiepao-prod/server?type=0";//正式服
        get_server_interface    = "http://114.115.210.145:8083/vesal-jiepao-test/server?type=0";//测试服
        fix_server_interface    = "v1/app/member/getCode";
        online_mode             = true;
        is_enter_server_control = false;
        is_has_app_buff         = false;
        isRotateScreen          = false;
        DebugLog.DebugLogInfo("---------------设备内存-------------------" + mem);
    }
示例#2
0
    public int siblingIndex; //记录物体transform

    //点击时,判断是否有子节点,如果有,进行生成
    //需要输入:  本节点名字 对应  子节点列表,列表计数为0,没有子节点
    //打开子节点,并为子节点赋值
    public void OnCreateClick()
    {
        GetComponent <MenuControl>().arrow.transform.localRotation = Quaternion.Euler(0, 0, -90);
        siblingIndex = gameObject.transform.GetSiblingIndex();
        print("当前条目位置 " + siblingIndex);
        if (nameList.Count > 0)
        {
            pos = int.Parse(nameList[0]);
            List <string> outlist = new List <string>();
            for (int i = 1; i < nameList.Count; i++)
            {
                bool is_create_node = false;
                check_NameList.Clear();
                Select_check(nameList[i]);
                bool isbreak = true;
                // print(nameList[i]+"  总树形结构查询长度:"+check_NameList.Count);
                //不是最后一级
                if (isbreak)
                {
                    for (int k = 0; k < check_NameList.Count; k++)
                    {
                        for (int m = 0; m < LoadModel.instance.models.Length; m++)
                        {
                            if (check_NameList[k] == LoadModel.instance.models[m].name)
                            {
                                // print("<color=#33FF00>   "+check_NameList[k]+" </color>");
                                is_create_node = true;
                                isbreak        = false;;
                            }
                        }
                    }
                }
                if (is_create_node)
                {
                    // print("<color=#33FF00>   "+nameList[i]+" </color>");
                    outlist.Add(nameList[i]);
                }
            }

            //按父节点数组,生成子节点,每个子节点进行检查下一级赋值
            //遍历父节点记录的子节点
            for (int i = 0; i < outlist.Count; i++)
            {
                //判断是否包含子模型
                List <string> tem_nameList = new List <string>();
                LoadModel.instance.menuMessage.TryGetValue(outlist[i], out tem_nameList);
                GameObject game = Instantiate(LoadModel.instance.Catalog);
                game.SetActive(true);
                Transform trans = game.transform;
                trans.SetParent(LoadModel.instance.tree_panel_parent.transform);
                trans.localPosition = Vector3.zero;
                trans.localScale    = Vector3.one;

                game.transform.SetSiblingIndex(gameObject.transform.GetSiblingIndex() + i + 1);
                // print("<color=#33FF00>set siblingindex:"+game.transform.GetSiblingIndex()+" </color>");

                MenuControl menuControl = game.GetComponent <MenuControl>();
                menuControl.arrow.transform.localPosition      += new Vector3(pos * 43f - 43f, 0, 0);
                menuControl.eye.transform.localPosition        += new Vector3(pos * 43f - 43f, 0, 0);
                menuControl.text.transform.localPosition       += new Vector3(pos * 43f - 43f, 0, 0);
                menuControl.text.GetComponent <Text>().fontSize = 42 - pos * 2;
                menuControl.line.SetActive(false);
                menuControl.LabelName = outlist[i];
                if (LoadModel.instance.english.ContainsKey(outlist[i]))
                {
                    string txt = "";
                    LoadModel.instance.english.TryGetValue(outlist[i], out txt);
                    menuControl.text.GetComponent <Text>().text = txt;
                }
                else
                {
                    menuControl.text.GetComponent <Text>().text = outlist[i];
                }
                game.GetComponent <MenuControl>().nameList.AddRange(tem_nameList);
                game.name = outlist[i];
                if (!LoadModel.instance.named.ContainsKey(game.name))
                {
                    menuControl.modelName = string.Empty;
                }
                else
                {
                    menuControl.modelName = LoadModel.instance.named[game.name];
                }
                //排除中文显示错误
                if (!ContainChinese(menuControl.text.GetComponent <Text>().text))
                {
                    DebugLog.DebugLogInfo(menuControl.text.GetComponent <Text>().text + " 模型未找到中文");
                    game.SetActive(false);
                }
                else
                {
                    childs.Add(game);
                }
            }
        }
        IsCreateMenu = false; //关闭子节点创建功能,(已经创建完成)
    }
示例#3
0
    //资源下载更新
    private void AnalysisResourceList()
    {
        //检查更新
        dd_config_path = PublicClass.filePath + "download.dat";

        Ready_Download_list = load_download_list_from_file(dd_config_path);
        DebugLog.DebugLogInfo(dd_config_path + Ready_Download_list.Count);
        foreach (Download_Vesal_info temp in Ready_Download_list)
        {
            DebugLog.DebugLogInfo(temp.name + temp.version);
        }

        if (Ready_Download_list == null)
        {
            Ready_Download_list = new List <Download_Vesal_info>();
        }
        Download_list = DataManager.GetStructInfo(PublicClass.platform);
        if (!PublicClass.online_mode)
        {
            PublicClass.DataManagerStatus = DataIntState.GoNextScence; //启动场景跳转
            return;
        }
        //本地
        //网络
        // downloadText.text = "正在分析数据...";
        DebugLog.DebugLogInfo("数据长度..." + Download_list.Count);

        for (int i = 0; i < Download_list.Count; i++)
        {
            //            int founded = 0;
            Download_list[i].isNeedDownload = true;
            for (int k = 0; k < Ready_Download_list.Count; k++)
            {
                if (Ready_Download_list[k].name.Replace("s_", "") == Download_list[i].name.Replace("s_", ""))
                {
                    //本地存在,进行比较
                    Debug.Log(Ready_Download_list[k].name + "--" + Download_list[i].name + "--" + Ready_Download_list[k].version + "--" + Download_list[i].version);
                    if (Ready_Download_list[k].version == Download_list[i].version)
                    {
                        Download_list[i].isNeedDownload = false;
                    }
                    break;
                }
            }
        }

        Ready_Download_list.Clear();
        for (int i = 0; i < Download_list.Count; i++)
        {
            if (Download_list[i].isNeedDownload)
            {
                Ready_Download_list.Add(Download_list[i]);
            }
        }
        DebugLog.DebugLogInfo("生成下载列表长度 " + Ready_Download_list.Count);

        if (!MainConfig.isDownloadModel)
        {
            Ready_Download_list.Clear();
        }

        //如果资源列表为空
        if (Ready_Download_list.Count == 0)
        {
            PublicClass.DataManagerStatus = DataIntState.GoNextScence; //启动场景跳转
            //PublicClass.DataManagerStatus = DataIntState.HotFix;
            // PublicClass.DataManagerStatus = DataIntState.HotFix;//HotFix; //启动场景跳转
        }
        else
        {
            PublicClass.DataManagerStatus = DataIntState.Downloading; //开始下载
            DownloadNow();
        }
    }
示例#4
0
 //返回平台
 public void ExitProgram()
 {
     DebugLog.DebugLogInfo("back SceneSwitch");
     SceneManager.LoadScene("SceneSwitch");
 }
示例#5
0
    public static void InitStaticData()
    {
        if (PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.PPTPlayer || PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.pc)
        {
            int_load_AB_nums = 100;
        }
        else
        {
            int_load_AB_nums = 0;
        }

        int mem = SystemInfo.systemMemorySize;

#if UNITY_EDITOR
        //QualitySettings.currentLevel = QualityLevel.Fastest;
        //Quality = Run_Quality.POOL;
        QualitySettings.currentLevel = QualityLevel.Good;
        Quality = Run_Quality.GOOD;
#elif UNITY_STANDALONE_WIN
        if (mem <= 4400)
        {
            QualitySettings.currentLevel = QualityLevel.Fastest;
            Quality = Run_Quality.POOL;
        }
        else
        {
            QualitySettings.currentLevel = QualityLevel.Good;
            Quality = Run_Quality.GOOD;
        }
#elif UNITY_IOS
        if (mem <= 1100)
        {
            QualitySettings.currentLevel = QualityLevel.Fastest;
            Quality = Run_Quality.POOL;
        }
        else
        {
            QualitySettings.currentLevel = QualityLevel.Good;
            Quality = Run_Quality.GOOD;
        }
#elif UNITY_ANDROID
        if (mem <= 3300)
        {
            QualitySettings.currentLevel = QualityLevel.Fastest;
            Quality = Run_Quality.POOL;
        }
        else
        {
            QualitySettings.currentLevel = QualityLevel.Good;
            Quality = Run_Quality.GOOD;
        }
#else
#endif
        Debug.Log("Quality :" + Quality);
        cameraBackAxisPosition = Vector3.zero;
        cameraBackAxisRotation = Vector3.zero;
        currentState           = RunState.Loading;
        currentModle           = ModleChoose.MainModel;
        Difficult_Index        = 0;
        data_list_count        = 0;
        tableCount             = 15;
        //        app_json_str = "";

        filePath = Application.persistentDataPath + "/";
#if UNITY_EDITOR
        if (PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.PPTPlayer || PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.WeiKePlayer)
        {
            platform = asset_platform.pc;
            fileLocalStreamingPath = "file://" + Application.streamingAssetsPath + "/";
            filePath = Application.streamingAssetsPath + "/";
        }
        else if (PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.demo_pc || PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.pc)
        {
            platform = asset_platform.pc;
            fileLocalStreamingPath = Application.streamingAssetsPath + "/";
            filePath = Application.persistentDataPath.Substring(0, Application.persistentDataPath.LastIndexOf("AppData") + 7) + "/roaming/Vesal_unity_PC/";
        }
        else if (PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.plugin)
        {
            platform = asset_platform.pc;
            fileLocalStreamingPath = "file://" + Application.streamingAssetsPath + "/";
            filePath = Application.persistentDataPath.Substring(0, Application.persistentDataPath.LastIndexOf("AppData") + 7) + "/roaming/Vesal/";
        }
        else
        {
            platform = asset_platform.android;
            fileLocalStreamingPath = "file://" + Application.streamingAssetsPath + "/";
        }
#elif UNITY_IOS
        platform = asset_platform.ios;
        fileLocalStreamingPath = "file://" + Application.dataPath + "/Raw/";
#elif UNITY_ANDROID
        platform = asset_platform.android;
        fileLocalStreamingPath = "jar:file://" + Application.dataPath + "!/assets/";
#elif UNITY_STANDALONE_WIN
        platform = asset_platform.pc;
        fileLocalStreamingPath = Application.streamingAssetsPath + "/";
        //filePath = Application.persistentDataPath.Substring(0, Application.persistentDataPath.LastIndexOf("AppData") + 7) + "/roaming/Vesal_unity_PC/";
        if (PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.PPTPlayer || PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.WeiKePlayer)
        {
            filePath = Vesal_DirFiles.get_dir_from_full_path(Application.dataPath) + "PptPlayer_Data/StreamingAssets/";
        }
        else
        {
            filePath = Application.persistentDataPath.Substring(0, Application.persistentDataPath.LastIndexOf("AppData") + 7) + "/roaming/Vesal_unity_PC/";
        }
        Debug.Log("UNITY_STANDALONE_WIN filePath:" + filePath);
#endif

        tempPath = filePath + "temp/";

        Vesal_DirFiles.DelFile(tempPath + "temp.dat");

        vesal_db_path     = filePath + "db/";
        sign_texture_path = filePath + "sign_texture/";
        UpdatePath        = filePath + "Update/";
        SignPath          = filePath + "Android_sign/";
        ModelPath         = filePath + "model/";
        MedicalPath       = filePath + "Mediacl/";
        xluaPath          = filePath + "Lua-HotFix/";
        TimelineFilePath  = filePath + "Anim_Timeline/";
        WeiKePlayer_path  = filePath + "microlesson/";
        Video_path        = filePath + "acu_vdo/";
        Anim_TimelinePath = filePath + "Anim_Timeline/";
        BookMarkPath      = filePath + "BookmarkFile/";
        if (Quality == Run_Quality.GOOD)
        {
            MAX_Ab_num = 15;
        }
        else
        {
            MAX_Ab_num = 10;
        }

#if UNITY_DEBUG
        // get_server_interface = "http://api.vesal.cn:8000/vesal-jiepao-prod/server?type=0";
        get_server_interface = "http://118.24.119.234:8083/vesal-jiepao-test/server?type=0";
#else
        //get_server_interface = "http://api.vesal.cn:8000/vesal-jiepao-prod/server?type=0";//正式服
        get_server_interface = "http://114.115.210.145:8083/vesal-jiepao-test/server?type=0";//测试服
#endif
        fix_server_interface = "v1/app/member/getCode";

        //server_ip = vesal_network.Vesal_Network.get_ipfromlist(get_server_interface);
        //server_test_url = server_ip + fix_server_interface;

        online_mode             = true;
        is_enter_server_control = false;
        //        isLanScaple = true;
        //        isLanScaple = true;
        DataManagerStatus = DataIntState.Null;
        is_has_app_buff   = false;
        isRotateScreen    = false;
        DebugLog.DebugLogInfo("---------------设备内存-------------------" + mem);
    }
示例#6
0
 public void OpenTimerFlag()
 {
     DebugLog.DebugLogInfo("click");
     OpenTimer = true;
 }
 protected virtual void OnNavigationFailed(WWebView webView, int code, string url)
 {
     DebugLog.DebugLogInfo("00ff00", "OnNavigationFailed");
 }
示例#8
0
 void Start()
 {
     // DebugLog.DebugLogInfo("empty scene");
     DebugLog.DebugLogInfo("empty scene start");
 }
 protected virtual void OnStartNavigation(WWebView webView, string url)
 {
     DebugLog.DebugLogInfo("00ff00", "OnStartNavigation");
 }
示例#10
0
 protected virtual void OnNavigationCompleted(WWebView webView, string data)
 {
     DebugLog.DebugLogInfo("00ff00", "OnNavigationCompleted");
 }
示例#11
0
 protected virtual void OnEvaluateJavaScript(WWebView webView, string result)
 {
     DebugLog.DebugLogInfo("00ff00", "OnEvaluateJavaScript");
 }
示例#12
0
 void Start()
 {
     DebugLog.DebugLogInfo("初始化帧传送管理器");
     BtnStartControl();
 }
    void Update()
    {
        if (PublicClass.appstate != App_State.Running)
        {
            return;
        }
        isInModelControlArea = this.GetComponent <XT_MouseFollowRotation>().isInUiRect();
        //图谱模式的点击
        if (isInModelControlArea && PublicClass.currentModle == ModleChoose.SignModel && isacuSkin)
        {
            //图钉模式的点击
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            _rayResult = Physics.Raycast(ray, out RayInfo);
            Ray ray2 = UIcamera.ScreenPointToRay(Input.mousePosition);
            _rayResult2 = Physics.Raycast(ray2, out RayInfo2);
            //当射线与模型碰撞时进入
            if (_rayResult && !_rayResult2)
            {
                MeshRenderer rayTarget = RayInfo.transform.GetComponent <MeshRenderer>();
                if (rayTarget != null && (!EventSystem.current.IsPointerOverGameObject() || SceneManager.GetActiveScene().name == "WeiKePlayer"))
                {
                    //如果点击鼠标左键,记录按下时鼠标位置
                    if (Input.GetMouseButtonDown(0) || (Input.touchCount == 1 && Input.GetTouch(0).phase == TouchPhase.Began))
                    {
                        // isStartTimerSecond = true;
                        PublicClass.CurrentFingerState = FingerState.SingleFingerDown;
                        _pos = Input.mousePosition;
                    }
                    //如果鼠标抬起时位移很小,则判断为点击操作,将模型选中
                    if (Input.GetMouseButtonUp(0) || (Input.touchCount == 1 && Input.GetTouch(0).phase == TouchPhase.Ended))
                    {
                        if (dateTimeSecond < 0.3f)
                        {
                            ChooseSignModel(rayTarget.gameObject, TouchRotationModel.fingerTouch);
                        }
                    }
                }
            }
        }


        if (isInModelControlArea && PublicClass.currentModle == ModleChoose.MainModel)
        {
            Timer();
            TimerSecond();
            if (((Input.touchCount >= 1 && !EventSystem.current.IsPointerOverGameObject(Input.GetTouch(0).fingerId)) || (Input.touchCount == 0 && !EventSystem.current.IsPointerOverGameObject()) || isWeiKe))
            {
                Ray ray = new Ray();
                try
                {
                    ray = Camera.main.ScreenPointToRay(Input.mousePosition);
                }
                catch (Exception e)
                {
                    return;
                }
                _rayResult = Physics.Raycast(ray, out RayInfo);

                Ray ray2 = UIcamera.ScreenPointToRay(Input.mousePosition);
                _rayResult2 = Physics.Raycast(ray2, out RayInfo2);
                Ray        ray3 = new Ray();
                RaycastHit UIrayinfo;
                if (UIcamera != null)
                {
                    ray3 = UIcamera.ScreenPointToRay(Input.mousePosition);
                }
                //当射线与模型碰撞时进入
                if (_rayResult && !_rayResult2)
                {
                    if (isacuSkin)
                    {
                        GameObject rayTarget = RayInfo.transform.gameObject;

                        if (rayTarget != null)
                        {
                            //如果点击鼠标左键,记录按下时鼠标位置
                            if (Input.GetMouseButtonDown(0) || (Input.touchCount == 1 && Input.GetTouch(0).phase == TouchPhase.Began))
                            {
                                PublicClass.CurrentFingerState = FingerState.SingleFingerDown;
                                IsStartTimerSecond             = true; //判断是否是单击触控
                                dateTimeSecond = 0;
                                _pos           = Input.mousePosition;
                            }
                            else
                            {
                                PublicClass.InitFingerState();
                            }
                            //如果鼠标抬起时位移很小,则判断为点击操作,将模型选中
                            //抬起条件
                            if ((Input.GetMouseButtonUp(0) || (Input.touchCount == 1 && Input.GetTouch(0).phase == TouchPhase.Ended)))
                            {
                                if (dateTimeSecond < 0.3f)
                                {
                                    PublicClass.CurrentFingerState = FingerState.SingleFingerSinglePress; //单击
                                    IsStartTimerSecond             = false;
                                }
                                if (dateTime < 0.3f && isStartTimer)
                                {
                                    isFirstClick = false; //判断是否第一次点击
                                }
                                if (isFirstClick)
                                {
                                    if (PublicClass.CurrentFingerState == FingerState.SingleFingerSinglePress)
                                    {
                                        isStartTimer = true; //开始计时
                                    }
                                }
                                else
                                {
                                    PublicClass.CurrentFingerState = FingerState.SingleFingerDoublePress; //双击
                                    //GiveUiValue_new(rayTarget.GetComponent<Model>());
                                    isFirstClick = true;
                                }
                            }
                            else
                            {
                                PublicClass.InitFingerState();
                            }
                        }
                    }
                }
                else
                {
                    if (UIcamera != null)
                    {
                        if (_rayResult2)
                        {
                            return;
                        }
                        if (Physics.Raycast(ray3, out UIrayinfo))
                        {
                            return;
                        }
                    }
                    if (Input.GetMouseButtonDown(0) || (Input.touchCount == 1 && Input.GetTouch(0).phase == TouchPhase.Began))
                    {
                        PublicClass.CurrentFingerState = FingerState.SingleFingerDown;
                        IsStartTimerSecond             = true; //判断是否是单击触控
                        dateTimeSecond = 0;
                        _pos           = Input.mousePosition;
                    }
                    else
                    {
                        PublicClass.InitFingerState();
                    }
                    //如果鼠标抬起时位移很小,则判断为点击操作,将模型选中
                    if (Input.GetMouseButtonUp(0) || (Input.touchCount == 1 && Input.GetTouch(0).phase == TouchPhase.Ended))
                    {
                        if (dateTimeSecond < 0.3f)
                        {
                            DebugLog.DebugLogInfo("空白单机");
                            PublicClass.CurrentFingerState = FingerState.SingleFingerSinglePress;     //单击
                            IsStartTimerSecond             = false;
                        }
                        if (PublicClass.CurrentFingerState == FingerState.SingleFingerSinglePress)
                        {
                            //if (!SceneModels.instance.get_Multi_Selection())
                            //{
                            //    //取消点击空白处取消选择
                            //    SceneModels.instance.CancleSelect();

                            ////if (PublicClass.app.app_type == "acu")
                            ////    acuTEST.Instance.initacu();


                            //    Debug.Log("ClickBlank");
                            //    UnityMessageManager.Instance.SendMessageToRN(new UnityMessage()
                            //    {
                            //        name = "ClickBlank",
                            //        callBack = (data) => { DebugLog.DebugLogInfo("message : " + data); }
                            //    });
                            //}
                        }
                    }
                    else
                    {
                        PublicClass.InitFingerState();
                    }
                }
            }
        }
    }
示例#14
0
 public void Call()
 {
     DebugLog.DebugLogInfo("cancel loading ----------------------");
 }
示例#15
0
 public void LoadLocalFile()
 {
     webView.NavigateFile("触诊.html");
     DebugLog.DebugLogInfo("LoadLocalFile demo.html");
 }
示例#16
0
    List <Download_Vesal_info> load_list;//异步加载assetbundle资源列表

    public void load_assets_A(List <Download_Vesal_info> targetList, Action load_complete = null)
    {
        if (PublicClass.id_model_dic == null)
        {
            PublicClass.id_model_dic = new Dictionary <string, int>();
        }

        load_list = new List <Download_Vesal_info>();
        foreach (Download_Vesal_info temp in targetList)
        {
            if ((temp.type == null) || (temp.type.ToUpper() == "") || (temp.type.ToUpper() == "AB"))
            {
                load_list.Add(temp);
                PublicClass.total_load_list.Add(temp);
            }
        }
        //DebugLog.DebugLogInfo("--------------------可以加载模型长度:" + PublicClass.total_load_list.Count);
        //foreach (Download_Vesal_info temp in PublicClass.total_load_list)
        //{
        //    DebugLog.DebugLogInfo("total list:" + temp.name);
        //}

        //去掉多余的加载项
        int max = load_list.Count;

        for (int k = PublicClass.int_load_AB_nums; k < max; k++)
        {
            load_list.RemoveAt(PublicClass.int_load_AB_nums);
        }

        Unity_Tools.StarTime("获取远程数据计时-------");
        progress.Set_Progress("模型正在加载中...", Call);
        length = 0;
        count  = 0;
        length = load_list.Count;
        DebugLog.DebugLogInfo("--------------------加载模型长度:" + length);
        ////加载公共库异常处理
        //if (load_list.Count == 0)
        //{
        //    progress.Set_Progress("加载数据错误...", Call);
        //}
//这是在未PPTPlayer 播放时,启动时指定vsl文件而给与解压
        if (PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.PPTPlayer || PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.WeiKePlayer)
        {
            isUnzipDown = true;
            string[] CommandLineArgs = Environment.GetCommandLineArgs();
            for (int i = 0; i < CommandLineArgs.Length; i++)
            {
                string tmpStr = CommandLineArgs[i];
                //tmpStr = "C:\\vesalplayer\\WK0000001_5.vsl";
                Debug.Log("GetCommandLineArgs::" + tmpStr);
                vesal_log.vesal_write_log("GetCommandLineArgs::" + tmpStr);
                if (tmpStr.Contains(".vsl") || tmpStr.Contains(".VSL"))
                {
                    Debug.Log("GetCommandLineArgs::" + tmpStr);
                    //SelectFile(tmpStr);
                    PPTHomePageController.TempFilePath = PPTHomePageController.getTempPath();
                    vesal_log.vesal_write_log("PPTHomePageController.TempFilePath " + PPTHomePageController.TempFilePath);
                    StartCoroutine(Vesal_DirFiles.UnZipAsync(tmpStr, PPTHomePageController.TempFilePath, ManagerModelUnzipCall, true));
                    PPTResourcePool.isSkipUnzip = true;
                    isUnzipDown = false;
                    PPTHomePageController.currentFilePath = tmpStr;
                    break;
                }
            }
        }



        if (load_list.Count > 0)
        {
            //设置加载标记
            start_load_model = true;
            timer            = 0;
            //            progress = GameObject.Find("LoadingCanvas").transform.GetComponent<ShowProgress>();

            StartCoroutine(LoadPrefabModel(PublicClass.filePath + load_list[0].name, Vesal_DirFiles.remove_name_suffix(load_list[0].name), count_load));
        }
        else
        {
            start_load_model = false;
            this.ReadModelInfo();
            if (PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.demo_pc)
            {
                SceneManager.LoadScene("SceneSwitchInteral");
            }
            else
            {
                SceneManager.LoadScene("SceneSwitch");
            }
        }
    }
示例#17
0
 public void ChangeStatesUI()
 {
     PublicClass.currentState = RunState.UI;
     DebugLog.DebugLogInfo("EnterUI");
 }
示例#18
0
 private void Awake()
 {
     DebugLog.DebugLogInfo("empty scene awake");
     SceneManager.LoadScene("RecordPlay");
 }
示例#19
0
 public void ChangeStatesPlay()
 {
     PublicClass.currentState = RunState.Playing;
     DebugLog.DebugLogInfo("ExitUI");
 }
示例#20
0
    IEnumerator ScreenShot(string shotname)
    {
        //关闭页面
        //  SetBookmarkPanel(false);
        Debug.Log("11111111111111111111111");
        BookMarkInfo bookMarkInfo = new BookMarkInfo()
        {
            //id = index,
            bookmarkType = PublicClass.app.app_id,
            bookmarkName = shotname,
            //  bookmarkPicture = File.ReadAllBytes(imagePath),
            modelState   = Vesal_DirFiles.Object2Bytes(new SceneModelState()),
            btnState     = Vesal_DirFiles.Object2Bytes(new SceneBtnState()),
            cameraParams = Vesal_DirFiles.Object2Bytes(new CameraParams())
        };
        BookMark bookMark = new BookMark();

        bookMark.markInfo = bookMarkInfo;

        //插入书签封装类对象
        // local_db.DataService("Command.db");
        // local_db.Insert(bookMarkInfo);
        //  local_db.Close();
        //.insertOne<Customer, int>(customer, customer._id);
        DebugLog.DebugLogInfo("创建书签 " + shotname);
        BaseCommand command = new PlayerCommand();

        command.ExecuteCommand();
        DebugLog.DebugLogInfo("书签信息 " + bookMarkInfo);

        string strJson = JsonConvert.SerializeObject(bookMarkInfo);
        // StateData.Instance.StatePath.Add(strJson);

        //string path = @PublicClass.filePath + "StateSave/" + PublicClass.app.app_id+".Json";
        string       path = @PublicClass.BookMarkPath + PublicClass.app.app_id + ".Json";
        StreamWriter sw;
        FileInfo     file = new FileInfo(path);

        if (!file.Exists)
        {
            //如果此文件不存在则创建
            sw = file.CreateText();
        }
        else
        {
            //如果此文件存在则打开
            file.Delete();
            sw = file.CreateText();
        }
        sw.WriteLine(strJson);
        //注意释放资源
        sw.Close();
        sw.Dispose();


        yield return(0);

        Debug.Log("保存完成");
        yield return(null);
        //记录数据

        //创建一个新书签,传入当前时间为id,书签名称,装载图片数据流,序列化模型状态,开关状态以及摄像机参数
    }
示例#21
0
    void ReadModel()
    {
        Model_Group = new List <GameObject>();


        // string temp_path = PublicClass.tempPath + "temp.dat";
        // Vesal_DirFiles.GetAbfile_Synchronize(PublicClass.filePath + Asset_ab_name, temp_path);

        // AssetBundle model = AssetBundle.LoadFromFile(temp_path);
        // DebugLog.DebugLogInfo("-------------" + Asset_ab_name);
        // //读取信息,显示目标模型
        // // AssetBundle model = AssetBundle.LoadFromFile(AppOpera.game_path + Asset_ab_name);
        // GameObject obj = (GameObject)model.LoadAsset(Prefab_Inner_name, typeof(GameObject));
        // realObj = Instantiate(obj);
        // model.Unload(false);

        // Vesal_DirFiles.DelFile(temp_path);

        //载入模型的 信息初始化 destory多余脚本 添加block 脚本
        //Model_parent = new GameObject("model").transform;//PublicClass.Transform_parent.transform.Find("framework/GG_LuGu_Diff");
        //last_Object = Instantiate(Manager_Trans);

        List <string> tempList = GetNounoNameList(PublicClass.app.app_id);

        for (int i = 0; i < tempList.Count; i++)
        {
            Transform temp_obj    = PublicClass.Transform_parent.transform.Find("framework/GG/GG_LuGu/" + tempList[i]);
            Transform last_Object = Instantiate(temp_obj);
            last_Object.gameObject.SetActive(true);
            // Manager_Trans = GameObject.Find(Last_group_name).transform;
            last_Object.SetParent(Model_parent, true);
            last_Object.gameObject.SetActive(true);
            //last_Object.localPosition = Vector3.zero;
        }
        Model_parent.transform.localPosition = new Vector3(PublicClass.Transform_parent.transform.localPosition.x, PublicClass.Transform_parent.transform.localPosition.y + 1.5f, PublicClass.Transform_parent.transform.localPosition.z - 3.2f); // PublicClass.Transform_parent.transform.localPosition+2*Vector3.up ;
        Model_parent.transform.localRotation = Quaternion.Euler(-90, 0, 0);                                                                                                                                                                       //PublicClass.Transform_parent.transform.localRotation;
        Model_parent.transform.localScale    = 2 * Vector3.one;
        // realObj.SetActive(false);
        Model[]      remove_models = Model_parent.GetComponentsInChildren <Model>();
        List <Model> ya_list       = new List <Model>();

        string[] fix_model = GetFixModelName(PublicClass.Difficult_Index);

        for (int i = 0; i < remove_models.Length; i++)
        {
            if (remove_models[i].name.Contains("Ya"))
            {
                ya_list.Add(remove_models[i]);
                continue;
            }

            bool is_fix = false;
            for (int j = 0; j < fix_model.Length; j++)
            {
                if (remove_models[i].name.Contains(fix_model[j]))
                {
                    is_fix = true;
                    continue;
                }
            }
            if (!is_fix)
            {
                Model_Group.Add(remove_models[i].gameObject);
            }
        }
        for (int i = 0; i < ya_list.Count; i++)
        {
            Destroy(ya_list[i].gameObject);
        }
        DebugLog.DebugLogInfo("拼图个数:  " + Model_Group.Count);
        Add_block_componet(Model_Group);
        BlockManager.Instance.InitTargetPosition();//记录显示模型的初始化位置

        SetFrameMesh();


        ChangeModel_position(Model_Group);//随机位置
    }
 public void DontRotate()
 {
     IsRotate = false;
     DebugLog.DebugLogInfo("rotatestate " + IsRotate);
 }
示例#23
0
 //首次进入和强杀unity后传递msg调用  加载资源
 public void LoadReasource(string invalid_msg)
 {
     temp_msg = "";
     DebugLog.DebugLogInfo("初次加载  " + invalid_msg);
     // DataManager.instance.PreAssets(); //预加载模型
 }
示例#24
0
 public void Get_Params(int index)
 {
     DebugLog.DebugLogInfo("LoadScene(Blocks)");
     PublicClass.Difficult_Index = index;
     SceneManager.LoadScene("Blocks");
 }
示例#25
0
    public void ReadBookMark()
    {
        if(btnState.isSplitBtnUI!=SplitMode.isSpliteMode)
        {
            //SceneModels.instance.set_Multi_Selection(false);

            PublicClass.splitmode.OpenSplitMode();

        }

        if (btnState.isMultiBtnUI == false)
        {
            SceneModels.instance.set_Multi_Selection(false);
            // SceneModels.instance.CancleSelect();
            UIChangeTool.ShowOneObject(XT_AllButton.Instance.openMu, XT_AllButton.Instance.closeMu, false);
            // XT_AllButton.Instance.multiSelectBtn.GetComponent<Image>().color = Color.white;
            //XT_TouchContorl.Instance.expPanel.SetActive(false);
        }
        else
        {
            SceneModels.instance.set_Multi_Selection(true);
            // XT_AllButton.Instance.multiSelectBtn.GetComponent<Image>().color = new Color(1, 1, 1, 0.5f);
            UIChangeTool.ShowOneObject(XT_AllButton.Instance.openMu, XT_AllButton.Instance.closeMu, true);
            //进入多选模式将下方解释窗口置为true
            XT_TouchContorl.Instance.expPanel.SetActive(true);
        }

        DebugLog.DebugLogInfo("交互模块赋值");
        Interaction.instance.gameObject.transform.localPosition = new Vector3(cameraParams.positionx, cameraParams.positiony, cameraParams.distance);

        Interaction.instance.rotateAxis.transform.localPosition = new Vector3(cameraParams.rotateAxis.x, cameraParams.rotateAxis.y, cameraParams.rotateAxis.z);
        Interaction.instance.y = cameraParams.rotation.x;
        Interaction.instance.x = cameraParams.rotation.y;
        Interaction.instance.rotateAxis.transform.rotation = Quaternion.Euler(-cameraParams.rotation.x, cameraParams.rotation.y, 0);

        DebugLog.DebugLogInfo("场景模型信息");
        Model[] tempAllmodel = SceneModels.instance.Get_scope_models();
        DebugLog.DebugLogInfo("场景模型长度 " + tempAllmodel.Length);

        try
        {
            //解析场景模型信息
            for (int i = 0; i < tempAllmodel.Length; i++)
            {
                modelState outState = modelsState.SceneModelStateDict[tempAllmodel[i].name];
                if (outState.isActive)
                {

                    tempAllmodel[i].gameObject.transform.position = new Vector3(outState.position.x, outState.position.y, outState.position.z);
                    tempAllmodel[i].BecomeDisplay();
                    if (outState.isSeleted)
                    {
                        SceneModels.instance.ChooseModel(tempAllmodel[i]);
                    }
                    else
                    {
                        tempAllmodel[i].BecomeNormal();
                    }
                    if (outState.isFade)
                    {
                        tempAllmodel[i].BecomeTranslucent();
                    }
                }
                else
                {
                    tempAllmodel[i].BecomeHide();
                }
            }
        }
        catch (System.Exception e)
        {
            DebugLog.DebugLogInfo("Message  " + e.Message);
            DebugLog.DebugLogInfo("StackTrace  " + e.StackTrace);
        }
    }
示例#26
0
 public static void StarTime(string debug_log)
 {
     log = debug_log;
     DebugLog.DebugLogInfo(debug_log);
     startTime = (double)Time.time;
 }
示例#27
0
    public void Init()
    {
        str             = showname.Split(',');
        activeMuscleStr = activeMuscleName.Split(',');
        if (secondaryMuscleName != null)
        {
            secondaryMuscleStr = secondaryMuscleName.Split(',');
        }
        if (PublicClass.modelAndChild == null)
        {
            grandFa = model.GetComponentsInChildren <Transform>();
            PublicClass.modelAndChild = grandFa;
        }
        else
        {
            if (PublicClass.modelAndChild[0] == null)
            {
                grandFa = model.GetComponentsInChildren <Transform>();
                PublicClass.modelAndChild = grandFa;
            }
            else
            {
                grandFa = PublicClass.modelAndChild;
            }
        }
        DebugLog.DebugLogInfo("Start model Count" + grandFa.Length);
        fas = fa.Split(',');

        for (int i = 0; i < muscleTex.Length; i++)
        {
            mainHighLightMaterials[i].SetTexture("_MainTex", muscleTex[i]);
            secondaryHighLightMaterials[i].SetTexture("_MainTex", muscleTex[i]);
        }



        foreach (Transform child in grandFa)
        {
            child.gameObject.SetActive(false);
            for (int i = 0; i < str.Length; i++)
            {
                for (int j = 0; j < fas.Length; j++)
                {
                    if (child.name == fas[j])
                    {
                        child.gameObject.SetActive(true);
                        break;
                    }
                    //
                }



                if (child.name == str[i])
                {
                    bool ismuscle = false;
                    child.gameObject.SetActive(true);

                    for (int j = 0; j < secondaryMuscleStr.Length; j++)
                    {
                        if (child.name == secondaryMuscleStr[j])
                        {
                            secondaryMuscles.Add(child.GetComponent <SkinnedMeshRenderer>());
                            child.gameObject.AddComponent <MeshCollider>();
                            child.gameObject.AddComponent <MuscleData>();
                            addMuscleData(child.gameObject, false);
                            muscle.Add(child.gameObject);
                            ismuscle = true;
                            break;
                        }
                    }

                    for (int j = 0; j < activeMuscleStr.Length; j++)
                    {
                        if (child.name == activeMuscleStr[j])
                        {
                            activeMuscles.Add(child.GetComponent <SkinnedMeshRenderer>());
                            child.gameObject.AddComponent <MeshCollider>();
                            child.gameObject.AddComponent <MuscleData>();
                            muscle.Add(child.gameObject);
                            addMuscleData(child.gameObject, true);
                            ismuscle = true;
                            break;
                        }
                    }

                    if (!ismuscle)
                    {
                        bones.Add(child.gameObject);
                    }
                    //  Debug.Log(child.GetComponent<SkinnedMeshRenderer>().sharedMaterial.name);
                    break;
                }
            }
        }
        //for (int i = 0; i < showp.Length; i++)
        //{
        //    showp[i].SetActive(true);
        //}
        createUI.activeMeshRenderers    = activeMuscles;
        createUI.secondaryMeshRenderers = secondaryMuscles;
        createUI.InitMuscleNameUI();
        uiFunction.muscles = muscle;
        uiFunction.bones   = bones;
        model.SetActive(true);
    }