Browse Source

修复bug

“hujiajun” 1 year ago
parent
commit
5521ec152c

+ 12 - 10
Assets/HotUpdate/BaseTemPlate.cs

@@ -85,7 +85,16 @@ public class BaseTemPlate : MonoBehaviour
         {
             HideCollider();
         }
-       // HideCollider();
+
+        if (GetComponent<BoxCollider>() != null)
+            GetComponent<BoxCollider>().enabled = GameManager.Instance.IsStartEditor;
+        if (GetComponent<BoundingBox>() != null)
+            GetComponent<BoundingBox>().enabled = GameManager.Instance.IsStartEditor;
+        if (GetComponent<ManipulationHandler>() != null)
+            GetComponent<ManipulationHandler>().enabled = GameManager.Instance.IsStartEditor;
+        if (transform.Find("BoundingBox") != null)
+            transform.Find("BoundingBox").gameObject.SetActive(GameManager.Instance.IsStartEditor);
+        // HideCollider();
     }
 
     protected virtual void OnEnable()
@@ -100,21 +109,14 @@ public class BaseTemPlate : MonoBehaviour
     public virtual void HideCollider()
     {
         state = true;
-        if (GetComponent<BoxCollider>() != null)
-            GetComponent<BoxCollider>().enabled = GameManager.Instance.IsStartEditor;
-        if (GetComponent<BoundingBox>() != null)
-            GetComponent<BoundingBox>().enabled = GameManager.Instance.IsStartEditor;
-        if (GetComponent<ManipulationHandler>() != null)
-            GetComponent<ManipulationHandler>().enabled = GameManager.Instance.IsStartEditor;
-        if (transform.Find("BoundingBox") != null)
-            transform.Find("BoundingBox").gameObject.SetActive(GameManager.Instance.IsStartEditor);
     }
 
+
     /// <summary>
     /// 设置素材属性
     /// </summary>
     /// <param name="value">当前素材数据</param>
-    public virtual void SetData(MaterialObjValue value, int updateTime)
+    public virtual void SetData(MaterialObjValue value, long updateTime)
     {
         m_SuCaiData = value;
      //   Debug.Log("@@@@@ " );

+ 9 - 5
Assets/HotUpdate/DownloadResManager.cs

@@ -47,7 +47,8 @@ public class DownloadResManager : MonoSingleton<DownloadResManager>
         listFaildMaterial = new List<DownLoadMaterial>();
         qDownload = new Queue<DownLoadMaterial>();
 
-       // PlayerPrefs.DeleteAll();
+        Debug.Log("DGJ  CompletedMaterial ==>" + path + "CompletedMaterial.txt");
+        // PlayerPrefs.DeleteAll();
         //先判断是否存在,再创建
         if (!File.Exists(path + "CompletedMaterial.txt"))
         {
@@ -189,11 +190,10 @@ private bool Screen(DownLoadMaterial downloadMaterial)
         {
             if (downloadMaterial.downLoadPath == listCompletedMaterial[j].downLoadPath)
             {
-                if (downloadMaterial.updataTime == listCompletedMaterial[j].updataTime)
-                    finish = true;
+                if (LoginPanel.downloadMatList.ContainsKey(downloadMaterial.downLoadPath) &&LoginPanel.downloadMatList[downloadMaterial.downLoadPath] == listCompletedMaterial[j].updataTime)
+                        finish = true;
             }
         }
-      //  Debug.Log("DGJ  ===> Screen  " + finish +"  "+ qDownload.Count);
         if (!finish)
         {
             listNotMaterial.Add(downloadMaterial);
@@ -289,7 +289,11 @@ public class DownLoadMaterial
 {
     public string downLoadPath { get; set; }
     public string localLoadPath { get; set; }
-    public long updataTime { get; set; }
+
+    private long _updataTime;
+    public long updataTime { get { return _updataTime; } set {
+            Debug.Log(value+"DGJ  ===> Screen " + downLoadPath);
+            _updataTime = value; } }
 
     public string type { get; set; }
 

+ 30 - 13
Assets/HotUpdate/GameManager.cs

@@ -233,6 +233,7 @@ public class GameManager : MonoSingleton<GameManager>
     public Toggle EditorToggle;
     private void Awake()
     {
+        m_IroBot.gameObject.SetActive(false);
 
         // Debug.unityLogger.logEnabled = false;
     }
@@ -557,6 +558,14 @@ public class GameManager : MonoSingleton<GameManager>
 
                 }
             }
+            if (BatteryStateNotification != null)
+            {
+                BatteryStateNotification.SetActive(false);
+            }else
+            {
+                BatteryStateNotification = GameObject.Find("BatteryStateNotification");
+                BatteryStateNotification.SetActive(false);
+            }
         },1,-1);
         tstart = new ThreadStart(subThread);
         thread = new Thread(tstart);
@@ -565,7 +574,7 @@ public class GameManager : MonoSingleton<GameManager>
         StartCoroutine(startSendPos());
 
     }
-
+    GameObject BatteryStateNotification;
         IEnumerator startSendPos()
     {
 
@@ -765,22 +774,12 @@ public class GameManager : MonoSingleton<GameManager>
         m_SettingPanel.gameObject.SetActive(true);
         m_EditorPanel.Init();
         m_SettingPanel.Init();
-        yield return new WaitForSeconds(0.5f);
+        bool isReboot = false;
         try
         {
             if (RouteCtr && RouteCtr.List_route != null && RouteCtr.List_route[0] && RouteCtr.List_route[0].GetComponent<LineRenderer>() && RouteCtr.List_route[0].GetComponent<LineRenderer>().positionCount > 0)
             {
-                Vector3[] v3list = new Vector3[RouteCtr.List_route[0].GetComponent<LineRenderer>().positionCount];
-                RouteCtr.List_route[0].GetComponent<LineRenderer>().GetPositions(v3list);
-                Player.MovePoints = v3list.ToList();// RouteCtr.CurrentPoints;
-                                                    //判断选择那个虚拟导游
-                                                    //int id = ChooseIroBot();
-
-                //if (id < 3)
-                //{
-                //m_IroBot = Irobots[id - 1];
-                m_IroBot.gameObject.SetActive(true);
-                m_IroBot.Points = Player.MovePoints;
+                isReboot = true;
                 //}
             }
 
@@ -789,7 +788,25 @@ public class GameManager : MonoSingleton<GameManager>
         {
 
         }
+
+        if(isReboot)
+        {
+
+            Vector3[] v3list = new Vector3[RouteCtr.List_route[0].GetComponent<LineRenderer>().positionCount];
+            RouteCtr.List_route[0].GetComponent<LineRenderer>().GetPositions(v3list);
+            Player.MovePoints = v3list.ToList();// RouteCtr.CurrentPoints;
+                                                //判断选择那个虚拟导游
+                                                //int id = ChooseIroBot();
+
+            m_IroBot.Points = Player.MovePoints;
+            //if (id < 3)
+            //{
+            //m_IroBot = Irobots[id - 1];
+            m_IroBot.gameObject.SetActive(true);
+        }
+
         IsRuning = true;
+
         m_SetBtn.gameObject.SetActive(true);
         InitCrystals();
         InitBoxColliders();

+ 1 - 1
Assets/HotUpdate/IrobotMove.cs

@@ -21,7 +21,7 @@ public class IrobotMove : MonoBehaviour
     private bool m_IsWalk;
     private Animator m_Animator;
 
-    private void Start()
+   void OnEnable()
     {
         //  if (GameObject.Find("NRCameraRig") != null)
         NRCameraRig = OpenXRCamera.Instance.head;//GameObject.Find("NRCameraRig").GetComponent<Transform>();

+ 1 - 10
Assets/HotUpdate/LocalLoadManager.cs

@@ -95,7 +95,6 @@ public class LocalLoadManager : MonoSingleton<LocalLoadManager>
 
         if (!File.Exists(downloadMaterial.localLoadPath))
         {
-            Debug.Log("DGJ  ====》 文件不存在 " + downloadMaterial.localLoadPath);
             MsgHandler.SendMsg(downloadMaterial.downLoadPath, new Msg(downloadMaterial.downLoadPath, null));
         }
         else
@@ -105,15 +104,7 @@ public class LocalLoadManager : MonoSingleton<LocalLoadManager>
                 long fileSize = new FileInfo(downloadMaterial.localLoadPath).Length;
 
                 byte[] buffer = new byte[fileSize]; // 设置一个读取缓冲区
-
-                int bytesRead;
-                while ((bytesRead = fs.Read(buffer, 0, buffer.Length)) > 0)
-                {
-                    // 在这里处理读取到的数据
-                    // Console.WriteLine("Read " + bytesRead + " bytes.");
-                }
-
-                yield return bytesRead == 0;
+                yield return fs.ReadAsync(buffer, 0, buffer.Length);
                 dicLoaclData.Add(downloadMaterial.downLoadPath, buffer);
                 // isDownLoad = true;
                 MsgHandler.SendMsg(downloadMaterial.downLoadPath, new Msg(downloadMaterial.downLoadPath, buffer));

+ 9 - 1
Assets/HotUpdate/LoginPanel.cs

@@ -778,6 +778,14 @@ public class LoginPanel : BaseUI
                         DownLoadMaterial data1 = new DownLoadMaterial();
                         string filename = Path.GetFileName(matObj.DownloadPath);
                         data1.downLoadPath = matObj.DownloadPath;
+                        if(downloadMatList.ContainsKey(data1.downLoadPath))
+                        {
+                            downloadMatList[data1.downLoadPath] = mat.updateTime;
+                        }else
+                        {
+                            downloadMatList.Add(data1.downLoadPath,mat.updateTime);
+
+                        }
                         data1.updataTime = mat.updateTime;
                         data1.localLoadPath = Application.persistentDataPath + "/Material/" + filename;
                         listMaterail.Add(data1);
@@ -788,7 +796,7 @@ public class LoginPanel : BaseUI
 
        
     }
-
+    public static Dictionary<string, int> downloadMatList = new Dictionary<string, int>();
     /// <summary>
     /// 是否记住密码
     /// </summary>

+ 2 - 0
Assets/HotUpdate/Patch_VideoController.cs

@@ -68,6 +68,8 @@ public class Patch_VideoController : AbstractController
                 }else
                 {
                     boundingBox.enabled = true;
+                    if (transform.Find("BoundingBox") && transform.Find("BoundingBox").gameObject != null)
+                        transform.Find("BoundingBox").gameObject.SetActive(true);
                 }
 
 

+ 28 - 23
Assets/HotUpdate/TemplateImage.cs

@@ -52,7 +52,7 @@ public class TemplateImage : BaseTemPlate
         HideCollider();
     }
 
-    public override void SetData(MaterialObjValue value, int updateTime)
+    public override void SetData(MaterialObjValue value, long updateTime)
     {
         base.SetData(value, updateTime);
         if (!GameManager.Instance.IsRuning)
@@ -68,7 +68,7 @@ public class TemplateImage : BaseTemPlate
         DownLoadMaterial data = new DownLoadMaterial();
         data.downLoadPath = value.DownloadPath;
         data.localLoadPath = Application.persistentDataPath + "/Material/" + Path.GetFileName(value.DownloadPath);
-        data.updataTime = GameManager.Instance.m_SceneValue.updateTime;
+        data.updataTime = updateTime;//GameManager.Instance.m_SceneValue.updateTime;
         data.type = "1";
         MsgHandler.AddListener(data.downLoadPath, HandleMsg);
         DownloadResManager.Instance.DownLoad(data);
@@ -83,33 +83,38 @@ public class TemplateImage : BaseTemPlate
             Texture2D texture = new Texture2D(1, 1);
 
             OpenCVForUnity.CoreModule.Mat _mat = null;
-            GameManager.Instance.AddThead(() =>
+
+            Loom.RunAsync(() =>
             {
                 Debug.Log("加載完成222222222222222222");
-                _mat =GameManager.zoomByteByOpenCV((byte[])msg.Value);
+                _mat = GameManager.zoomByteByOpenCV((byte[])msg.Value);
 
-            }, () =>
-            {
-                Debug.Log("加載完成111111111111");
-                texture = GameManager.TextureByMat(_mat);
-                Sprite sprite = Sprite.Create(texture, new UnityEngine.Rect(0, 0, texture.width, texture.height), Vector2.one * 0.5f);
-                m_Image.sprite = sprite;
-                _mat.release();
-                _mat = null;
+                Debug.Log("1111111");
+                Loom.QueueOnMainThread(() =>
+                {
 
-                Texture2D tex = transform.Find("Canvas/Image").GetComponent<Image>().sprite.texture;
+                    Debug.Log("加載完成111111111111");
+                    texture = GameManager.TextureByMat(_mat);
+                    Sprite sprite = Sprite.Create(texture, new UnityEngine.Rect(0, 0, texture.width, texture.height), Vector2.one * 0.5f);
+                    m_Image.sprite = sprite;
+                    _mat.release();
+                    _mat = null;
 
+                    Texture2D tex = transform.Find("Canvas/Image").GetComponent<Image>().sprite.texture;
 
-                if (tex.height > tex.width)
-                {
-                    float bl = ((float)tex.height / (float)tex.width);
-                    transform.Find("Canvas").GetComponent<RectTransform>().sizeDelta = new Vector2(500 / bl, 500);
-                }
-                else
-                {
-                    float bl = ((float)tex.width / (float)tex.height);
-                    transform.Find("Canvas").GetComponent<RectTransform>().sizeDelta = new Vector2(500, 500 / bl);
-                }
+
+                    if (tex.height > tex.width)
+                    {
+                        float bl = ((float)tex.height / (float)tex.width);
+                        transform.Find("Canvas").GetComponent<RectTransform>().sizeDelta = new Vector2(500 / bl, 500);
+                    }
+                    else
+                    {
+                        float bl = ((float)tex.width / (float)tex.height);
+                        transform.Find("Canvas").GetComponent<RectTransform>().sizeDelta = new Vector2(500, 500 / bl);
+                    }
+
+                });
             });
 
          //   texture.LoadImage((byte[])msg.Value);

+ 94 - 31
Assets/HotUpdate/TemplateModel.cs

@@ -27,15 +27,15 @@ public class TemplateModel : BaseTemPlate
         {
             if (m_ModelObj && m_ModelObj.GetComponent<Animation>())
             {
-                Debug.Log("Animation===>1"+ m_ModelObj.name);
+                Debug.Log("Animation===>1" + m_ModelObj.name);
 
                 Animation _animation = m_ModelObj.GetComponent<Animation>();
                 List<AnimationClip> _animations = _animation.GetAllAnimationClips();
                 m_ModelObj.GetComponent<Animation>().Play(_animations[0].name, PlayMode.StopAll);
             }
         }
-        if(this.gameObject.GetComponent<AudioSource>())
-        this.gameObject.GetComponent<AudioSource>().Play();
+        if (this.gameObject.GetComponent<AudioSource>())
+            this.gameObject.GetComponent<AudioSource>().Play();
     }
 
     private IEnumerator LoadModel()
@@ -44,7 +44,7 @@ public class TemplateModel : BaseTemPlate
         if (GameManager.Instance.IsRuning && m_ModelObj == null)
         {
             //Debug.Log(Data.name);
-            Debug.Log("DGJ ==>>   "+Data.localLoadPath);
+            Debug.Log("DGJ ==>>   " + Data.localLoadPath);
             var ab = AssetBundle.LoadFromFileAsync(Data.localLoadPath);
             yield return ab;
             if (ab == null)
@@ -75,15 +75,15 @@ public class TemplateModel : BaseTemPlate
                         {
                             Debug.LogError(" GHZ_OOBE_230721  物体加载失败,请查看是否导入相关Packages ");
                             obj = new GameObject();
-                          
+
                         }
-                        m_ModelObj = GameObject.Instantiate(obj,transform);
+                        m_ModelObj = GameObject.Instantiate(obj, transform);
                         m_ModelObj.name = "GongYe";
 
-                        if (GameObject.Find("AudioManager") ==null)
+                        if (GameObject.Find("AudioManager") == null)
                         {
                             GameObject audio = Resources.Load<GameObject>("AudioManager");
-                            if(audio ==null)
+                            if (audio == null)
                             {
                                 Debug.LogError("  GHZ_OOBE_230721 Packages内AudioManager组件丢失");
                                 audio = new GameObject();
@@ -102,7 +102,7 @@ public class TemplateModel : BaseTemPlate
                         break;
                 }
 
-              
+
 
                 //if (ab.LoadAllAssets<GameObject>()[0].name == "MRVideo")
                 //m_ModelObj.AddComponent<MovieScreen>();
@@ -114,7 +114,7 @@ public class TemplateModel : BaseTemPlate
                 ab.assetBundle.Unload(false);
                 HideCollider();
             }
-          
+
 
 
 
@@ -129,7 +129,7 @@ public class TemplateModel : BaseTemPlate
     }
     public void LoadModel(AssetBundle ab)
     {
-      GameManager.Instance.StartCoroutine(LoadABModel(ab));
+        GameManager.Instance.StartCoroutine(LoadABModel(ab));
         //LoadABModel(ab);
     }
     private IEnumerator LoadABModel(AssetBundle ab)
@@ -189,7 +189,7 @@ public class TemplateModel : BaseTemPlate
 
             gameObject.AddComponent<ManipulationHandler>();
             gameObject.AddComponent<BoundingBox>();
-           // yield return new WaitForSeconds(0.3f);
+            // yield return new WaitForSeconds(0.3f);
             ab.Unload(false);
             HideCollider();
             ModelItem.isLoad = false;
@@ -201,16 +201,16 @@ public class TemplateModel : BaseTemPlate
         base.OnAwake();
     }
 
-    public override void SetData(MaterialObjValue value, int updateTime)
+    public override void SetData(MaterialObjValue value, long updateTime)
     {
-       
+
         base.SetData(value, updateTime);
         //if (gameObject.GetComponent<Collider>() != null)
         //{
         //    Destroy(gameObject.GetComponent<Collider>());
         //}
         //下载列表中加入数据
-        if (!GameManager.Instance.IsRuning|| Data == null)
+        if (!GameManager.Instance.IsRuning || Data == null)
         {
             //   DownloadManager.Instance.AddDownloadData(Data);
 
@@ -219,7 +219,7 @@ public class TemplateModel : BaseTemPlate
             this.Data = data;
             data.downLoadPath = value.DownloadPath;
             data.localLoadPath = Application.persistentDataPath + "/Material/" + Path.GetFileName(value.DownloadPath);
-            data.updataTime = GameManager.Instance.m_SceneValue.updateTime;
+            data.updataTime = updateTime;//GameManager.Instance.m_SceneValue.updateTime;
             data.type = "3";
             MsgHandler.AddListener(value.DownloadPath, HandleMsg);
             DownloadResManager.Instance.DownLoad(data);
@@ -253,14 +253,14 @@ public class TemplateModel : BaseTemPlate
             //}
 
         }
-       
+
     }
 
     private void HandleMsg(Msg msg)
     {
         Debug.Log("DGJ   TemplateModel ");
 
-        if(msg.Value!=null)
+        if (msg.Value != null)
         {
             if (IsAB())
                 LoadABModel();
@@ -284,8 +284,8 @@ public class TemplateModel : BaseTemPlate
         bool finish = false;
 
         string fileName = Path.GetFileName(Data.localLoadPath);
-        Debug.Log("HJJ   fileName===>"+ fileName);
-        if(fileName.Contains(".ghb") ||!fileName.Contains("."))
+        Debug.Log("HJJ   fileName===>" + fileName);
+        if (fileName.Contains(".ghb") || !fileName.Contains("."))
         {
             finish = true;
         }
@@ -295,20 +295,83 @@ public class TemplateModel : BaseTemPlate
 
     private void LoadABModel()
     {
-        AssetBundle ab = AssetBundle.LoadFromFile(Data.localLoadPath);
-        if (ab == null)
+
+        GameManager.Instance.StartCoroutine(LoadABModelNew());
+        /**/
+    }
+    static Dictionary<string,GameObject> loadPathstatic = new Dictionary<string, GameObject>();
+    private IEnumerator LoadABModelNew()
+    {
+        /*
+        AssetBundleCreateRequest ab = AssetBundle.LoadFromFileAsync(Data.localLoadPath);
+        yield return ab;
+        if (ab.assetBundle == null)
         {
             Debug.Log("Failed to load AssetBundle!");
-            return;
+            yield return null;
+        }
+        else
+        {
+            AssetBundleRequest golist = ab.assetBundle.LoadAllAssetsAsync<GameObject>();
+            yield return golist;
+
+            AssetBundleRequest assetrequest = ab.assetBundle.LoadAssetAsync<GameObject>(golist.allAssets[0].name);
+            yield return assetrequest;
+            GameObject prefab = (GameObject)assetrequest.asset;
+            m_ModelObj = Instantiate(prefab, transform);
+            ab.assetBundle.Unload(false);
+
+            ManipulationHandler manipulation = gameObject.AddComponent<ManipulationHandler>();
+            manipulation.enabled = false;
+            BoundingBox boundingBox = gameObject.AddComponent<BoundingBox>();
+            boundingBox.enabled = false;
+
+        }*/
+
+        
+        if(loadPathstatic.ContainsKey(Data.localLoadPath))
+        {
+            while(!loadPathstatic[Data.localLoadPath])
+            {
+                yield return null;
+            }
+
+            GameObject prefab = (GameObject)loadPathstatic[Data.localLoadPath];
+            m_ModelObj = Instantiate(prefab, transform);
+            ManipulationHandler manipulation = gameObject.AddComponent<ManipulationHandler>();
+            manipulation.enabled = false;
+            BoundingBox boundingBox = gameObject.AddComponent<BoundingBox>();
+            boundingBox.enabled = false;
+        }
+        else
+        {
+            loadPathstatic.Add(Data.localLoadPath,null);
+            AssetBundleCreateRequest ab = AssetBundle.LoadFromFileAsync(Data.localLoadPath);
+            yield return ab;
+            if (ab.assetBundle == null)
+            {
+                Debug.Log("Failed to load AssetBundle!");
+                yield return null;
+            }
+            else
+            {
+                AssetBundleRequest golist = ab.assetBundle.LoadAllAssetsAsync<GameObject>();
+                yield return golist;
+
+                AssetBundleRequest assetrequest = ab.assetBundle.LoadAssetAsync<GameObject>(golist.allAssets[0].name);
+                yield return assetrequest;
+                loadPathstatic[Data.localLoadPath]= (GameObject)assetrequest.asset;
+                GameObject prefab = (GameObject)assetrequest.asset;
+                m_ModelObj = Instantiate(prefab, transform);
+                ab.assetBundle.Unload(false);
+
+                ManipulationHandler manipulation = gameObject.AddComponent<ManipulationHandler>();
+                manipulation.enabled = false;
+                BoundingBox boundingBox = gameObject.AddComponent<BoundingBox>();
+                boundingBox.enabled = false;
+
+            }
         }
-        var prefab = ab.LoadAsset<GameObject>(ab.LoadAllAssets<GameObject>()[0].name);
-        m_ModelObj = Instantiate(prefab, transform);
-        ab.Unload(false);
-
-        ManipulationHandler manipulation = gameObject.AddComponent<ManipulationHandler>();
-        manipulation.enabled = false;
-        BoundingBox boundingBox = gameObject.AddComponent<BoundingBox>();
-        boundingBox.enabled = false;
     }
     /// <summary>
     /// 解压

+ 1 - 1
Assets/HotUpdate/TemplateText.cs

@@ -61,7 +61,7 @@ public class TemplateText : BaseTemPlate
         CanvasHeight = m_Text.GetComponent<RectTransform>().sizeDelta.y + 60;
     }
 
-    public override void SetData(MaterialObjValue value, int updateTime)
+    public override void SetData(MaterialObjValue value, long updateTime)
     {
         Debug.Log("Text +++++" + value.TextBJ);
         Debug.Log("Text +++++" + value.textContent);

+ 2 - 2
Assets/HotUpdate/TemplateVideo.cs

@@ -126,7 +126,7 @@ public class TemplateVideo : BaseTemPlate
             setScale = false;
         }
     }
-    public override void SetData(MaterialObjValue value, int updateTime)
+    public override void SetData(MaterialObjValue value, long updateTime)
     {
         base.SetData(value, updateTime);
         if (!GameManager.Instance.IsRuning|| Data == null)
@@ -136,7 +136,7 @@ public class TemplateVideo : BaseTemPlate
             DownLoadMaterial data = new DownLoadMaterial();
             data.downLoadPath = value.DownloadPath;
             data.localLoadPath = Application.persistentDataPath + "/Material/" + Path.GetFileName(value.DownloadPath);
-            data.updataTime = GameManager.Instance.m_SceneValue.updateTime;
+            data.updataTime = updateTime;
             data.type = "3";
             MsgHandler.AddListener(value.DownloadPath, HandleMsg);
             DownloadResManager.Instance.DownLoad(data);

+ 3 - 1
Assets/HotUpdate/UserSceneUI.cs

@@ -22,7 +22,9 @@ public class UserSceneUI : UserBaseUI<UserSceneUI>
         //加载预制体
         Debug.Log("UI   LoadResources===>");
         // GameScene.Instance.gotoScenes("147");
-        obj = GameObject.Instantiate(Resources.Load<GameObject>("SceneChoose2"));
+        UnityEngine.Object @object = ResMgr.Instance.Load("SceneChoose2");
+        GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(@object as GameObject);
+        obj = gameObject;//GameObject.Instantiate(Resources.Load<GameObject>("SceneChoose2"));
         obj.transform.parent = GameScene.Instance.Canvas.transform;
         obj.transform.localPosition = Vector3.zero;
         obj.transform.localEulerAngles = Vector3.zero;

+ 1 - 0
Assets/Plugins/Android/AndroidManifest.xml

@@ -15,4 +15,5 @@
     <meta-data android:name="com.nreal.supportDevices" android:value="NrealLight|NrealAir" />
   </application>
   <uses-permission android:name="android.permission.BLUETOOTH" />
+  <uses-permission android:name="android.permission.RECORD_AUDIO" />
 </manifest>

+ 3 - 3
ProjectSettings/ProjectSettings.asset

@@ -938,6 +938,7 @@ PlayerSettings:
   metroSplashScreenUseBackgroundColor: 1
   platformCapabilities:
     WindowsStoreApps:
+      EnterpriseAuthentication: False
       OfflineMapsManagement: False
       HumanInterfaceDevice: False
       Location: False
@@ -949,7 +950,6 @@ PlayerSettings:
       PrivateNetworkClientServer: False
       InternetClientServer: False
       VideosLibrary: False
-      BackgroundMediaPlayback: False
       Objects3D: False
       RemoteSystem: False
       BlockedChatMessages: False
@@ -971,10 +971,10 @@ PlayerSettings:
       PointOfService: False
       RecordedCallsFolder: False
       Contacts: False
-      InternetClient: True
       Proximity: False
+      InternetClient: True
       CodeGeneration: False
-      EnterpriseAuthentication: False
+      BackgroundMediaPlayback: False
   metroTargetDeviceFamilies: {}
   metroFTAName: 
   metroFTAFileTypes: []