private T GetInstanceSafe() { var instance = _objectInstantiator.Instantiate(); if (instance == null) { throw new ObjectInstantiationException($"Failed to initialize {typeof(T)} instance"); } instance.PoolManager = _poolManager; return(instance); }
public GameObject InstantiateAsOriginal() { GameObject gameObject = null; if (instantiator != null) { gameObject = instantiator.Instantiate(original); } else { gameObject = GameObject.Instantiate(original); } gameObject.SetActive(true); return(gameObject); }
public GameObject InstantiateAsOriginal() { Assert.IsTrue(original != null, "Original should never be null here"); GameObject gameObject = null; if (instantiator != null) { gameObject = instantiator.Instantiate(original); } else { gameObject = GameObject.Instantiate(original); } gameObject.SetActive(true); return(gameObject); }