loudixvmuniu/Assets/_Scripts/Application/SceneCtrls/VideoRawTextureClearCtrl.cs

33 lines
950 B
C#
Raw Permalink Normal View History

2025-01-12 15:26:31 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Video;
/*******************************************************************************
*Create By CG
*Function
*******************************************************************************/
namespace ZXK.LouDiXvMuNiu
{
public class VideoRawTextureClearCtrl : MonoBehaviour
{
2025-06-06 13:33:22 +08:00
public string name;
public VideoPlayer player;
2025-01-12 15:26:31 +08:00
RenderTexture _renderTexture;
private void Awake()
{
2025-06-06 13:33:22 +08:00
player = transform.GetComponent<VideoPlayer>();
player.url = Application.streamingAssetsPath + "/AVProVideo/" + name;
2025-01-12 15:26:31 +08:00
_renderTexture = transform.GetComponent<VideoPlayer>().targetTexture;
}
private void OnEnable()
{
_renderTexture.Release();
}
private void OnDisable()
{
_renderTexture.Release();
}
}
}