Browse Source

新增自动播放字段

DGJ 1 year ago
parent
commit
f0b1ec6595

+ 4 - 0
Assets/2.0/User/Model/ModelList.cs

@@ -20,6 +20,8 @@ public class ModelList: System.ICloneable
 
     public string typesetting { get; set; }
 
+    public bool autoplay { get; set; }
+
     public ObjectTransform objectTransform { get; set; }
 
     public Transform materalLibrary;
@@ -28,6 +30,7 @@ public class ModelList: System.ICloneable
 
     private GameObject _model;
 
+
     //组合模型数据
     public GameObject Model
     {
@@ -188,6 +191,7 @@ public class ModelList: System.ICloneable
                     go.SetActive(true);
                     TemplateVideo video = go.AddComponent<TemplateVideo>();
                     video.localSavePath = Application.persistentDataPath + "/Material/" + Path.GetFileName(objs[i].DownloadPath);
+                    video.autoplay = material.autoplay;
                     //var videoitem = go.AddComponent<TemplateVideo>();
                     //videoitem.SetData(mat, material.updateTime);
                     break;

+ 16 - 11
Assets/2.0/User/Trigger/VufroiaTrigger.cs

@@ -58,22 +58,27 @@ public class VufroiaTrigger
         yield return observer;
         // Create an Image Target from the database.
 
-        List<ObserverBehaviour> list = new List<ObserverBehaviour>();
-
-        foreach (ObserverBehaviour item in observer)
+        if(observer !=null)
         {
-            list.Add(item);
-        }
+            List<ObserverBehaviour> list = new List<ObserverBehaviour>();
 
-        int count = 0;
+            foreach (ObserverBehaviour item in observer)
+            {
+                list.Add(item);
+            }
 
-        foreach (string item in usi.SpotsList.Keys)
-        {
-            if (list.Count > count)
-                usi.SpotsList[item].setObVuforia(list[count]);
-            count++;
+            int count = 0;
+
+            foreach (string item in usi.SpotsList.Keys)
+            {
+                if (list.Count > count)
+                    usi.SpotsList[item].setObVuforia(list[count]);
+                count++;
+            }
         }
 
+       
+
         UIManager.Instance.HideUI(UINameConfig.LoadingPanel);
         UserSceneUI.Instance.obj.GetComponent<UserChooseScene>().st.SetActive(true);
     }

+ 10 - 0
Assets/COSScripts/DownloadResManager.cs

@@ -80,6 +80,7 @@ public class DownloadResManager : MonoSingleton<DownloadResManager>
         Debug.Log(listDLMaterial.Count);
         for (int i = 0; i < listDLMaterial.Count; i++)
         {
+            Debug.Log(" DGJ DownLoad ===>" + listDLMaterial[i].downLoadPath);
             Screen(listDLMaterial[i]);
         }
      //   COSDownLoad cos = new COSDownLoad();
@@ -165,7 +166,16 @@ public class DownloadResManager : MonoSingleton<DownloadResManager>
 /// <returns></returns>
 private bool Screen(DownLoadMaterial downloadMaterial)
     {
+
        bool  finish = false;
+
+        if(string.IsNullOrEmpty(downloadMaterial.downLoadPath))
+        {
+
+            Debug.LogError( "  素材 没有下载地址 ");
+            return finish;
+        }
+
         for (int j = 0; j < listCompletedMaterial.Count; j++)
         {
             if (downloadMaterial.downLoadPath == listCompletedMaterial[j].downLoadPath)

+ 16 - 9
Assets/Scripts/Blue/Command/PointFileGetUrlCommand.cs

@@ -59,17 +59,24 @@ public class PointFileGetUrlCommand : ICommand
               //  PointFileData PointFile = JsonConvert.DeserializeObject<PointFileData>(message);
 
               //  this.GetService<IPointService>().DownloadPointFile(PointFile.url, fileType);
+              if(!string.IsNullOrWhiteSpace(downLoadPath))
+                {
+                    DownLoadMaterial data = new DownLoadMaterial();
+                    data.downLoadPath = downLoadPath;
+                    data.localLoadPath = Application.persistentDataPath + "/Map Data/" + Path.GetFileName(downLoadPath);
+                    Debug.Log("DGJ    byte   " + data.downLoadPath);
+                    data.updataTime = 0;// GameManager.Instance.m_SceneValue.updateTime;
+                    data.type = "-1";
+                    MsgHandler.AddListener(downLoadPath, HandleMsg);
 
+                    DownloadResManager.Instance.DownLoad(data);
+                }
+                else
+                {
+                    Debug.LogError("当前场景未上传点云文件 ");
+                }
 
-                DownLoadMaterial data = new DownLoadMaterial();
-                data.downLoadPath = downLoadPath;
-                data.localLoadPath = Application.persistentDataPath + "/Map Data/" + Path.GetFileName(downLoadPath);
-                Debug.Log("DGJ    byte   " + data.downLoadPath);
-                data.updataTime = 0;// GameManager.Instance.m_SceneValue.updateTime;
-                data.type = "-1";
-                MsgHandler.AddListener(downLoadPath, HandleMsg);
-
-                DownloadResManager.Instance.DownLoad(data);
+               
             }
         }
     }

+ 3 - 3
Assets/Scripts/Config/DataConfig.cs

@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
 using UnityEngine;
 
 public class DataConfig : MonoBehaviour
@@ -235,9 +235,9 @@ public class MaterialObl
     /// 排版
     /// 1-单排平铺,2-单排扇形,3-双排平铺,4-双排扇形,5-巨幕
     /// </summary>
-    public string typesetting;
-
+    public string typesetting { get; set; }
 
+    public bool autoplay { get; set; }
 
 
     public MaterialObl()

+ 9 - 2
Assets/Scripts/LayoutTemplate/TemplateVideo.cs

@@ -14,6 +14,8 @@ public class TemplateVideo : BaseTemPlate
     public string spid;
     public string videoid;
 
+    public bool autoplay;
+
     protected override void OnEnable()
     {
         //localSavePath = Application.persistentDataPath + "/Material/" + Path.GetFileName(Data.downloadPath);
@@ -34,8 +36,13 @@ public class TemplateVideo : BaseTemPlate
                 m_Video.SetUrl(null);
             }
         }
-        m_Video.transform.GetComponent<VideoPlayBtn>().m_IsPlaying = false;
-        m_Video.transform.GetComponent<VideoPlayBtn>().PlayVideo();
+        if(autoplay)
+        {
+            m_Video.transform.GetComponent<VideoPlayBtn>().m_IsPlaying = false;
+            m_Video.transform.GetComponent<VideoPlayBtn>().PlayVideo();
+
+        }
+
 
         setScale = true;
     }

+ 41 - 9
Assets/Scripts/UI/GameManager.cs

@@ -277,7 +277,7 @@ public class GameManager : MonoSingleton<GameManager>
                         UIManager.Instance.HideUI(UINameConfig.LoadingPanel);
                         downLoadCount = 0;
                         UIManager.Instance.ShowUI(UINameConfig.LoadingPanel, typeof(LoadingPanel), (int)ELoadState.updateEnd);
-                      //  isShowDownTip = false;
+                        isShowDownTip = false;
                        // TimerMgr.Instance.DestroyTimer(t);
                     }
                 }
@@ -728,7 +728,7 @@ public class GameManager : MonoSingleton<GameManager>
         //设置小地图景点
         //  m_CalMap.SettingMapPoint(ListCrystals);
        
-        UIManager.Instance.ShowUI(UINameConfig.LoadingPanel, typeof(LoadingPanel), (int)ELoadState.download);
+        //UIManager.Instance.ShowUI(UINameConfig.LoadingPanel, typeof(LoadingPanel), (int)ELoadState.download);
         //  DownloadManager.Instance.UpdataData();
       
     }
@@ -805,7 +805,7 @@ public class GameManager : MonoSingleton<GameManager>
         //        }
         //    }
         //});
-
+        GameManager.Instance.isShowDownTip = true;
         DownloadResManager.Instance.StartDownLoad();
     }
 
@@ -1359,28 +1359,60 @@ public class GameManager : MonoSingleton<GameManager>
     {
         newmaterial = material;
         List<ObjectValue> objects = new List<ObjectValue>();
+        //switch (material.typesetting)
+        //{
+        //    case "1":
+        //        objects = SRTitleLayout.CalLayout(material, spoit, out newmaterial);
+        //        break;
+        //    case "2":
+        //        objects = SRSectorLayout.CalLayout(material, spoit, out newmaterial);
+        //        break;
+        //    case "3":
+        //        objects = DRTitleLayout.CalLayout(material, spoit, out newmaterial);
+        //        break;
+        //    case "4":
+        //        objects = DRFanLayout.CalLayout(material, spoit, out newmaterial);
+        //        break;
+        //    case "5":
+        //        objects = SRTitleLayout.CalLayout(material, spoit, out newmaterial,"5");
+        //        break;
+        //    case "自定义":
+        //        break;
+        //    default:
+        //        break;
+        //}
+
         switch (material.typesetting)
         {
             case "1":
-                objects = SRTitleLayout.CalLayout(material, spoit, out newmaterial);
+                SRTitleLayout.CalLayout(material, spoit, out newmaterial);
                 break;
             case "2":
-                objects = SRSectorLayout.CalLayout(material, spoit, out newmaterial);
+                SRTitleLayout.CalLayout(material, spoit, out newmaterial);
                 break;
             case "3":
-                objects = DRTitleLayout.CalLayout(material, spoit, out newmaterial);
+                SRTitleLayout.CalLayout(material, spoit, out newmaterial);
                 break;
             case "4":
-                objects = DRFanLayout.CalLayout(material, spoit, out newmaterial);
+                SRSectorLayout.CalLayout(material, spoit, out newmaterial);
                 break;
             case "5":
-                objects = SRTitleLayout.CalLayout(material, spoit, out newmaterial,"5");
+                DRTitleLayout.CalLayout(material, spoit, out newmaterial);
                 break;
-            case "自定义":
+            case "6":
+                DRTitleLayout.CalLayout(material, spoit, out newmaterial);
                 break;
+            case "7":
+                DRTitleLayout.CalLayout(material, spoit, out newmaterial);
+                break;
+            case "8":
+                DRFanLayout.CalLayout(material, spoit, out newmaterial);
+                break;
+
             default:
                 break;
         }
+
         return objects;
     }
 

+ 29 - 3
Assets/Scripts/UI/LoginPanel.cs

@@ -64,6 +64,8 @@ public class LoginPanel : BaseUI
 
         m_Logn = CacheTransform.Find("LoginBtn").GetComponent<Button>();
         m_RemenberPwd = CacheTransform.Find("RememberPwd").GetComponent<Toggle>();
+
+
         m_RemenberPwd.isOn = false;
         m_IsRemberPwd = false;
 
@@ -93,6 +95,28 @@ public class LoginPanel : BaseUI
         //m_SNBtn.onClick.AddListener(OnClickSnBtn);
 
         // OnClickLogin();
+
+        m_AccountStr = PlayerPrefs.GetString("Account", "");
+        m_PasswordStr = PlayerPrefs.GetString("Password", "");
+        int n = int.Parse(PlayerPrefs.GetString("IsremPwd", "0"));
+        m_RemenberPwd.isOn = n > 0 ? true : false;
+        m_IsRemberPwd = n > 0 ? true : false;
+
+
+        if (!string.IsNullOrWhiteSpace(m_AccountStr) && !string.IsNullOrWhiteSpace(m_PasswordStr))
+        {
+            m_Account.text = m_AccountStr;
+            m_Password.text = m_PasswordStr;
+            m_Logn.interactable = true;
+        }
+        else
+        {
+            m_Account.text = "";
+            m_Password.text = "";
+            m_AccountStr = "";
+            m_PasswordStr = "";
+            m_Logn.interactable = false;
+        }
     }
 
     #region UI监听事件
@@ -262,9 +286,9 @@ public class LoginPanel : BaseUI
 #if UNITY_EDITOR
         m_AccountStr = "4444@qq.com";
         m_AccountStr = "jiajun.hu@ghz-tech.com";
-        m_AccountStr = "1768147286@qq.com";
-        m_AccountStr = "bactest1@1.com";
-     //   m_AccountStr = "devtest1@1.com";
+      //  m_AccountStr = "1768147286@qq.com";
+       // m_AccountStr = "bactest1@1.com";
+        m_AccountStr = "advtest1@1.com";
 #endif
 
         if (string.IsNullOrWhiteSpace(m_AccountStr))
@@ -373,6 +397,8 @@ public class LoginPanel : BaseUI
         }
         else
         {
+          
+
             UserInfo.Instance.Token = obj["data"]["token"].ToString();
             COSDownLoad.Instance.Credential();
 

+ 1 - 1
Assets/Scripts/UI/SceneChoose.cs

@@ -97,7 +97,7 @@ public class SceneChoose : BaseUI
                     Debug.Log("scene.backgroundImages===>" + mes);
                     Debug.Log("scene.backgroundImages===>"+ scene.backgroundImages.Count);
                     GameManager.Instance.MapPicUrl = scene.backgroundImages[0].base64;
-                    GameManager.Instance.isShowDownTip = true;
+                  
                     GameManager.Instance.GetMinMap(scene, (bool back) =>
                     {
                         if (back)

+ 4 - 7
ProjectSettings/ProjectSettings.asset

@@ -147,10 +147,7 @@ PlayerSettings:
     16:9: 1
     Others: 1
   bundleVersion: 10.13.3
-  preloadedAssets:
-  - {fileID: 4800000, guid: c9f956787b1d945e7b36e0516201fc76, type: 3}
-  - {fileID: -6682207197718421661, guid: 8f422df2931cba0478c1fe8ab232b9a3, type: 2}
-  - {fileID: 3493090336618791480, guid: 2d049ae1db0e2b74c8251022ae6dcb95, type: 2}
+  preloadedAssets: []
   metroInputSource: 0
   wsaTransparentSwapchain: 0
   m_HolographicPauseOnTrackingLoss: 1
@@ -927,7 +924,7 @@ PlayerSettings:
   metroSplashScreenUseBackgroundColor: 1
   platformCapabilities:
     WindowsStoreApps:
-      CodeGeneration: False
+      EnterpriseAuthentication: False
       OfflineMapsManagement: False
       HumanInterfaceDevice: False
       Location: False
@@ -960,10 +957,10 @@ PlayerSettings:
       PointOfService: False
       RecordedCallsFolder: False
       Contacts: False
-      Proximity: False
       InternetClient: True
+      CodeGeneration: False
       BackgroundMediaPlayback: False
-      EnterpriseAuthentication: False
+      Proximity: False
   metroTargetDeviceFamilies:
     Desktop: False
     Holographic: False