using System.Collections; using System.Collections.Generic; using UnityEngine; public class FPS_UseLight : MonoBehaviour { //void OnEnable() //{ // var cam = Camera.main; // if (cam == null) return; // var customLight = cam.GetComponent(); // if (customLight == null) cam.gameObject.AddComponent(); //} //void OnDisable() //{ // var cam = Camera.main; // if (cam == null) return; // var customLight = cam.GetComponent(); // if (customLight != null) DestroyImmediate(customLight); //} }