using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Video; /******************************************************************************* *Create By CG *Function *******************************************************************************/ namespace ZXK.LouDiXvMuNiu { public class VideoRawTextureClearCtrl : MonoBehaviour { public string name; public VideoPlayer player; RenderTexture _renderTexture; private void Awake() { player = transform.GetComponent(); player.url = Application.streamingAssetsPath + "/AVProVideo/" + name; _renderTexture = transform.GetComponent().targetTexture; } private void OnEnable() { _renderTexture.Release(); } private void OnDisable() { _renderTexture.Release(); } } }