UnityScripterAI
Discord ↗
Link Copied to Clipboard
×
"create uicontroller with visibility switch option"
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class UIController : MonoBehaviour { public Transform camera; public RectTransform rawImage; public bool rotate; private void Update() { if (rotate) rawImage.rotation = Quaternion.Euler(0, 0, camera.rotation.eulerAngles.y); // Debug.Log(camera.rotation.y * ); } public void switchVisibility(GameObject go) { go.SetActive(!go.activeSelf); } }