/// <summary>
/// 移除游戏物体上的某个组件
/// </summary>
/// <param name="obj"></param>
/// <typeparam name="T"></typeparam>
public static void RemoveComponentFromObj<T>(GameObject obj) where T : Component
{
if (obj == null) return;
T com = obj.GetComponent<T>();
if (com != null)
{
GameObject.Destroy(com);
com = null;
}
}
移除游戏物体上的某个组件
于 2023-06-19 11:15:14 首次发布