1
0

CleanUp_0.gml 460 B

123456789
  1. /// oLight Clean Up Event
  2. // 如果结构体还没被清理
  3. if (variable_instance_exists(id, "light_struct") && light_struct != undefined) {
  4. // 大多数 Bulb 版本不需要手动调用 destroy,因为它们使用弱引用自动清理
  5. // 但为了 100% 的鲁棒性,如果有 .Free() 或 .Destroy() 方法,请调用它
  6. // 简单做法:直接设为 undefined,Bulb 的垃圾回收机制通常会处理掉它
  7. light_struct = undefined;
  8. }