25 lines
		
	
	
		
			615 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			615 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| 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<FPS_CustomLight>();
 | |
|    //    if (customLight == null) cam.gameObject.AddComponent<FPS_CustomLight>();
 | |
|    //}
 | |
| 
 | |
|     //void OnDisable()
 | |
|     //{
 | |
|     //    var cam = Camera.main;
 | |
|     //    if (cam == null) return;
 | |
| 
 | |
|     //    var customLight = cam.GetComponent<FPS_CustomLight>();
 | |
|     //    if (customLight != null) DestroyImmediate(customLight);
 | |
|     //}
 | |
| }
 |