Пример #1
0
        private void Awake()
        {
            throwableObjectPool = new ObjectPool <ThrowableObject>(
                () =>
            {
                GameObject gameObject = Finder.PrefabFactory.CreateThrowableObject(transform);
                gameObject.SetActive(false);
                ThrowableObject throwableObject = gameObject.GetComponent <ThrowableObject>();
                throwableObject.Thrower         = this;
                return(throwableObject);
            },
                throwableObjectPoolSize
                );

            waitForThrowNewObjectDelay = new FreezableWaitForSeconds(throwNextObjectDelay);
        }
Пример #2
0
 public void RemoveThrownObject(ThrowableObject thrownObject)
 {
     thrownObject.gameObject.SetActive(false);
     throwableObjectPool.PutObject(thrownObject);
 }