using System.Collections; using System.Collections.Generic; using Unity.VisualScripting.Antlr3.Runtime; using UnityEngine; using UnityEngine.UI; public class Control_Tv : MonoBehaviour { public static Control_Tv Instance; public Button OpenTv; public Transform Tv; bool isopen = false; private void Awake() { Instance = this; } void Start() { OpenTv.onClick.AddListener(() => { isopen = !isopen; OpenTvs(isopen); }); } public void OpenTvs(bool Isopen) { if (Isopen) { Tv.GetChild(0).GetComponent().materials[0].EnableKeyword("_EMISSION"); } else { Tv.GetChild(0).GetComponent().materials[0].DisableKeyword("_EMISSION"); } } }