23 lines
459 B
C#
23 lines
459 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Rendering.Universal;
|
|
|
|
public class UIToMainCamera : MonoBehaviour
|
|
{
|
|
public Canvas canvas;
|
|
|
|
private void Awake()
|
|
{
|
|
if (canvas == null)
|
|
{
|
|
canvas = GetComponent<Canvas>();
|
|
}
|
|
}
|
|
private void Start()
|
|
{
|
|
canvas.renderMode=RenderMode.ScreenSpaceCamera;
|
|
canvas.worldCamera = Camera.main;
|
|
}
|
|
}
|