Skip to content

Instantly share code, notes, and snippets.

@lizhug
Last active April 19, 2022 06:22
Show Gist options
  • Save lizhug/180efdac58c987a70881ad53f7eb15ad to your computer and use it in GitHub Desktop.
Save lizhug/180efdac58c987a70881ad53f7eb15ad to your computer and use it in GitHub Desktop.
Unity Player Video In Background Raw Image/Unity启动页面背景播放视频,类似王者荣耀
public string videoUrl;
public RawImage playRawImage;
public VideoPlayer videoPlayer;
void Start()
{
videoPlayer.url = videoUrl;
}
// Update is called once per frame
void Update()
{
if (videoPlayer.texture == null)
{
return;
}
playRawImage.texture = videoPlayer.texture;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment