using System.Collections; using System.Collections.Generic; using UnityEngine; public class VideoPlayBtn : MonoBehaviour { public GameObject Icon; public bool m_IsPlaying; public AVProVideoPlayer m_Video; private void Start() { if (m_Video == null) m_Video = GetComponent(); } public void PlayVideo() { Debug.Log("m_IsPlaying: " + m_IsPlaying); if (m_Video == null) return; Debug.Log(m_Video.GetUrl()); if (!m_IsPlaying) { // FengMian.gameObject.SetActive(false); m_Video.Play(); Icon.SetActive(false); } else { m_Video.Pause(); Icon.SetActive(true); } m_IsPlaying = !m_IsPlaying; } }