Exemplo n.º 1
0
        /// <summary>
        /// Check if pool seted and if not setup it
        /// </summary>
        /// <returns>Is already linked?</returns>
        public bool CheckProjectilePool()
        {
            if (projectilePool)
            {
                return(true);
            }

            GameObject environment = FindOrInstantiate(ENVIRONMENT_NAME);

            GameObject dynamic = FindOrInstantiate(DYNAMIC_NAME, DYNAMIC_PATH, environment.transform);

            projectilePool = FindOrInstantiate(PROJECTILE_POOL_NAME, PROJECTILE_POOL_PATH, dynamic.transform)
                             .AddComponent <ProjectilePool>();

            return(false);
        }
 private void OnEnable()
 {
     projectilePool = target as ProjectilePool;
 }