public void ChangeSingleComp(string compName, SingletonComponent comp) { if (m_singleCompDict.ContainsKey(compName)) { int index = componentType.GetComponentIndex(compName); heapComponentPool.PutObject(index, m_singleCompDict[compName]); m_singleCompDict[compName] = comp; } else { m_singleCompDict.Add(compName, comp); } comp.World = this; }