public void Reset() { if (!IsRelease()) { m_res.ReleaseReference(m_seed); m_res = null; m_seed = 0; } }
public void Initialize(ICMResource <T> res, int seed, Action onRelease = null) { Release(); this.m_res = res; this.m_seed = seed; if (null != onRelease) { this.m_releaseAction = onRelease; } }
public void Release(bool clearReleaseAction = false) { if (!IsRelease()) { if (null != m_releaseAction) { m_releaseAction.Invoke(); } m_res.ReleaseReference(m_seed); m_res = null; m_seed = 0; } if (null != m_releaseAction && clearReleaseAction) { m_releaseAction = null; } }