Browse Source

播放邏輯修改

胡佳骏 1 year ago
parent
commit
11a27f57ac

+ 1 - 1
Assets/COSScripts/DownloadResManager.cs

@@ -39,7 +39,7 @@ public class DownloadResManager : MonoSingleton<DownloadResManager>
         listFaildMaterial = new List<DownLoadMaterial>();
         qDownload = new Queue<DownLoadMaterial>();
 
-        PlayerPrefs.DeleteAll();
+       // PlayerPrefs.DeleteAll();
         //先判断是否存在,再创建
         if (!File.Exists(path + "CompletedMaterial.txt"))
         {

+ 16 - 8
Assets/Scripts/LayoutTemplate/TemplateVideo.cs

@@ -21,11 +21,13 @@ public class TemplateVideo : BaseTemPlate
 
     private void OnDisable()
     {
-        if(temQueue.Count>0)
+        Debug.Log("HJJ       停止播放");
+       m_Video.Stop();
+        if (temQueue.Count>0)
         temQueue = new Queue<TemplateVideo>();
     }
 
-    
+
 
     protected override void OnEnable()
     {
@@ -41,13 +43,7 @@ public class TemplateVideo : BaseTemPlate
 
                 m_Video.SetUrl(localSavePath);
 
-                if (autoplay)
-                {
-                    temQueue.Enqueue(this);
-                 //   m_Video.transform.GetComponent<VideoPlayBtn>().m_IsPlaying = false;
-                 //   m_Video.transform.GetComponent<VideoPlayBtn>().PlayVideo();
 
-                }
 
             }
             else
@@ -56,7 +52,19 @@ public class TemplateVideo : BaseTemPlate
             }
         }
 
+        if (autoplay)
+        {
+            Debug.Log("HJJ    开始自动播放" + localSavePath);
+            temQueue.Enqueue(this);
+            //   m_Video.transform.GetComponent<VideoPlayBtn>().m_IsPlaying = false;
+            //   m_Video.transform.GetComponent<VideoPlayBtn>().PlayVideo();
 
+        }
+        else
+        {
+
+            Debug.Log("HJJ    不需要自動播放" + localSavePath);
+        }
         setScale = true;
     }
    // private MediaPlayer MediaPlayer;

+ 1 - 0
Assets/Scripts/UI/LoginPanel.cs

@@ -420,6 +420,7 @@ public class LoginPanel : BaseUI
                 Debug.Log(jobect["data"]["type"].ToString());
                StartCoroutine( LoginCallBack2YS(2));
                 UserInfo.Instance.is20 = true;
+                GameManager.Instance.IsRuning = true;
             }
             else if (int.Parse(jobect["data"]["type"].ToString()) == 1)
             {