コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【Unity】InvalidOperationException: Trying to release an object that has already been released to the pool.

概要

InvalidOperationException:  
Trying to release an object that has already been released to the pool.

Unity のオブジェクトプールを使用した時に上記のエラーが発生する現象に遭遇した

m_objectPool.Release( gameObject );

すでにプールに戻されているオブジェクトをプールに戻そうとしていたことが原因だった