1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- using System.Collections;
- using System.Collections.Generic;
- using System.IO;
- using UnityEngine;
- public class TemplateVideo : BaseTemPlate
- {
- private VideoControl m_VideoCtr;
- protected override void OnEnable()
- {
-
- base.OnEnable();
- if (GameManager.Instance.IsRuning && string.IsNullOrWhiteSpace(m_VideoCtr.VideoURL))
- {
- if (File.Exists(Data.localSavePath))
- {
- m_VideoCtr.VideoURL = Data.localSavePath;
-
- }
- else
- {
- m_VideoCtr.VideoURL = null;
- }
- }
- m_VideoCtr.m_IsPlaying = false;
- m_VideoCtr.PlayVideo();
- }
- protected override void OnAwake()
- {
- base.OnAwake();
- m_VideoCtr = transform.Find("Screen/Video").GetComponent<VideoControl>();
- HideCollider();
- }
- public override void SetData(MaterialObjValue value, int updateTime)
- {
- base.SetData(value, updateTime);
- if (!GameManager.Instance.IsRuning)
- {
- DownloadManager.Instance.AddDownloadData(Data);
- }
- else
- {
- if (File.Exists(Data.localSavePath))
- {
- m_VideoCtr.VideoURL = Data.localSavePath;
- }
- else
- {
- m_VideoCtr.VideoURL = null;
- }
- }
- }
- public override void HideCollider()
- {
- base.HideCollider();
- }
- }
|