Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public struct PooledComponent<T> where T : MonoBehaviour {
- public T Component { get; private set; }
- public GameObject GameObject => pooledGameObject.gameObject;
- PooledGameObject pooledGameObject;
- public PooledComponent(PooledGameObject pooledGameObject) {
- this.pooledGameObject = pooledGameObject;
- Component = pooledGameObject.gameObject.GetComponent<T>();
- }
- public void Release() {
- Debug.Log("Releasing PC " + pooledGameObject);
- pooledGameObject.Release();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement