请注意,示例中使用了 FindObjectsOfType 方法而不是 FindObjectsByType,因为从 Unity 2023.1 版本开始,FindObjectsOfType 已被弃用,建议使用 FindObjectsByType。但由于 FindObjectsByType 在Unity 引擎中内置,你只需直接调用它,无需自行实现。 4. 测试 FindObjectsByType 函数的功能和正确性 要测试 FindObjectsByTy...
public static UnityEngine.Object[] FindObjectsByType (Type type, bool includeInactive = false, bool sort = true); Parameters type Type The type to search for. includeInactive Boolean If true, inactive objects will be included in the search. False by default. sort Boolean If false, resul...
同时有些是用到其他资源,jvm也不会进行回收,类似Io流中的FileInputStream使用到了硬盘资源,垃圾回收器...