Fix VideoPanel reference, automatically find Canvas/VideoPanel and add components if missing
This commit is contained in:
@@ -18,7 +18,10 @@ public class VideoController : MonoBehaviour
|
||||
private void Awake()
|
||||
{
|
||||
if (_rawImage == null) _rawImage = GetComponent<RawImage>();
|
||||
if (_rawImage == null) _rawImage = gameObject.AddComponent<RawImage>();
|
||||
|
||||
if (_videoPlayer == null) _videoPlayer = GetComponentInChildren<VideoPlayer>();
|
||||
if (_videoPlayer == null) _videoPlayer = gameObject.AddComponent<VideoPlayer>();
|
||||
|
||||
if (_videoPlayer != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user