|
@@ -9,36 +9,20 @@ public class TemplateVideo : BaseTemPlate
|
|
|
private Navigator.VideoControl m_VideoCtr;
|
|
|
private AVProVideoPlayer m_Video;
|
|
|
|
|
|
+ private string localSavePath;
|
|
|
protected override void OnEnable()
|
|
|
{
|
|
|
-
|
|
|
+ localSavePath = Application.persistentDataPath + "/Material/" + Path.GetFileName(Data.downloadPath);
|
|
|
base.OnEnable();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
if (GameManager.Instance.IsRuning && string.IsNullOrWhiteSpace(m_Video.GetUrl()))
|
|
|
{
|
|
|
- if (File.Exists(Data.localSavePath))
|
|
|
+
|
|
|
+ if (File.Exists(localSavePath))
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
- m_Video.SetUrl(Data.localSavePath);
|
|
|
+ m_Video.SetUrl(localSavePath);
|
|
|
|
|
|
}
|
|
|
else
|
|
@@ -80,10 +64,11 @@ public class TemplateVideo : BaseTemPlate
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (File.Exists(Data.localSavePath))
|
|
|
+ localSavePath = Application.persistentDataPath + "/Material/" + Path.GetFileName(Data.downloadPath);
|
|
|
+ if (File.Exists(localSavePath))
|
|
|
{
|
|
|
|
|
|
- m_Video.SetUrl(Data.localSavePath);
|
|
|
+ m_Video.SetUrl(localSavePath);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -97,12 +82,13 @@ public class TemplateVideo : BaseTemPlate
|
|
|
public void SetData(string url)
|
|
|
{
|
|
|
Debug.Log(url);
|
|
|
+ localSavePath = Application.persistentDataPath + "/Material/" + Path.GetFileName(Data.downloadPath);
|
|
|
|
|
|
|
|
|
|
|
|
if (m_Video == null)
|
|
|
m_Video = transform.Find("Screen/AVideo").GetComponent<AVProVideoPlayer>();
|
|
|
- m_Video.SetUrl(url);
|
|
|
+ m_Video.SetUrl(localSavePath);
|
|
|
|
|
|
}
|
|
|
|