浏览代码

Fix instances when deletion happened while factory is disabled (#7)

* Fix instances when deletion happened while factory is disabled
* Simplify code
/main
Thomas ICHÉ 5 年前
当前提交
89698c31
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5
      Runtime/Ingredients/Factory/Factory.cs

5
Runtime/Ingredients/Factory/Factory.cs


List<GameObject> m_Instances;
private void OnEnable()
{
m_Instances.RemoveAll(item => item == null);
}
private void OnDestroy()
{
if(ReapInstancesOnDestroy && m_Instances != null)

正在加载...
取消
保存