24 lines
		
	
	
		
			591 B
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			24 lines
		
	
	
		
			591 B
		
	
	
	
		
			C#
		
	
	
	
|  | using System.Collections; | |||
|  | using System.Collections.Generic; | |||
|  | using UnityEditor; | |||
|  | using UnityEngine; | |||
|  | 
 | |||
|  | public class ToolsManager : MonoBehaviour | |||
|  | { | |||
|  | #if UNITY_EDITOR | |||
|  |     [MenuItem("EditorTools/DestoryColl _F1", false, 1)] | |||
|  |     static void DestoryColl() | |||
|  |     { | |||
|  |         if (Selection.gameObjects.Length <= 0) | |||
|  |         { | |||
|  |             Debug.LogError("请选择至少一个游戏物体"); | |||
|  |             return; | |||
|  |         } | |||
|  |         for (int i = 0; i < Selection.gameObjects.Length; i++) | |||
|  |         { | |||
|  |             Selection.gameObjects[i].SetActive(!Selection.gameObjects[i].activeSelf); | |||
|  |         } | |||
|  |     } | |||
|  | #endif | |||
|  | } |