void initSpriteComponentPool() { // init sprite component pool if (transform.Find ("SpriteComponentPool") == null) throw new InvalidOperationException("Sprite component pool is missing."); spriteComponentPool = transform.Find ("SpriteComponentPool").GetComponent<GameObjectPool> (); spriteComponentPool.init (); // init sprite pool if (transform.Find ("SpriteComponentPool").transform.Find ("SpritePool") == null) throw new InvalidOperationException("Sprite pool is missing."); spritePool = transform.Find ("SpriteComponentPool").transform.Find ("SpritePool").GetComponent<GameObjectPool> (); spritePool.init (); }
void initWorldObjectPool() { if (transform.Find ("WorldObjectPool") == null) throw new InvalidOperationException("World object pool is missing."); worldObjectPool = transform.Find ("WorldObjectPool").GetComponent<GameObjectPool> (); worldObjectPool.init (); }