private void Awake() { if (!objectPool) { objectPool = EZObjectPool.CreateObjectPool(Resources.Load <GameObject>("Prefabs/GreenButton"), "GreenButtonPool", 2, true, true, true); } }
/// <summary> /// Sets up this effect's object pool. The pool will only be set up on the first call to this method, so calling it multiple times is safe. /// </summary> public void SetupPool() { if (muzzleEffectPool == null) { muzzleEffectPool = EZObjectPool.CreateObjectPool(Template.gameObject, Template.name, PoolSize, false, true, true); } }
void Awake() { //Object pool parameters: (object, name of pool, starting pool size, auto resize (should be true), instantiate immediate (should be true), shared pools) redBulletPool = EZObjectPool.CreateObjectPool(redBulletPrefab, "Red Bullets", 100, true, true, true); yellowBulletPool = EZObjectPool.CreateObjectPool(yellowBulletPrefab, "Yellow Bullets", 100, true, true, true); blueBulletPool = EZObjectPool.CreateObjectPool(blueBulletPrefab, "Blue Bullets", 100, true, true, true); }
// Use this for initialization void Start() { scene = SceneManager.GetActiveScene(); newHeight = new Vector3(transform.position.x, GameObject.Find("Player").transform.position.y, transform.position.z); Debug.Log(scene.name); if (scene.name == "Level1") { GetComponent <Renderer>().material.color = Color.red; selectColor = 0; } else if (scene.name == "Level2") { GetComponent <Renderer>().material.color = Color.yellow; selectColor = 1; } else if (scene.name == "Level3") { GetComponent <Renderer>().material.color = Color.blue; selectColor = 2; } else if (scene.name == "Level4") { GetComponent <Renderer>().material.color = Color.red; selectColor = 3; } yellowBulletPool = EZObjectPool.CreateObjectPool(yellowBulletPrefab, "Yellow Boss Bullets", 500, true, true, true); redBulletPool = EZObjectPool.CreateObjectPool(redBulletPrefab, "Red Boss Bullets", 500, true, true, true); blueBulletPool = EZObjectPool.CreateObjectPool(blueBulletPrefab, "Blue Boss Bullets", 500, true, true, true); }
/// <summary> /// Sets up this effect's object pool. The pool will only be set up on the first call to this method, so calling it multiple times is safe. /// </summary> public void SetupPool() { if (impactEffectPool == null) { impactEffectPool = EZObjectPool.CreateObjectPool(Template, Template.name, PoolSize, false, true, true); } }
void Initialize() { enemyBulletsPoolGreen = EZObjectPool.CreateObjectPool(tablesEtc.disparosEnemigos[0], "Bullets Enemy Green", 4, false, true, true); enemyBulletsPoolRed = EZObjectPool.CreateObjectPool(tablesEtc.disparosEnemigos[1], "Bullets Enemy Red", 5, false, true, true); enemyBulletsPoolFire = EZObjectPool.CreateObjectPool(tablesEtc.disparosEnemigos[2], "Bullets Enemy Fire", 4, false, true, true); enemyBombs = EZObjectPool.CreateObjectPool(bombPrefab, "Bombs Boss", 6, false, true, true); }
void Awake() { //Object pool parameters: (object, name of pool, starting pool size, auto resize (should be true), instantiate immediate (should be true), shared pools) enemy1Pool = EZObjectPool.CreateObjectPool(enemy1Prefab, "Enemy Type 1", 100, true, true, true); enemy2Pool = EZObjectPool.CreateObjectPool(enemy2Prefab, "Enemy Type 2", 100, true, true, true); enemy3Pool = EZObjectPool.CreateObjectPool(enemy3Prefab, "Enemy Type 3", 100, true, true, true); }
//private GameObject cactus; //private GameObject aloe; private void Awake() { cactusPrefab = Resources.Load("Cactus3") as GameObject; aloePrefab = Resources.Load("Aloe") as GameObject; CactusPool = EZObjectPool.CreateObjectPool(cactusPrefab, "CactusPool", 10, true, true, true); AloePool = EZObjectPool.CreateObjectPool(aloePrefab, "AloePool", 10, true, true, true); RumblePool = EZObjectPool.CreateObjectPool(rumblePrefab, "RumblePool", 10, true, true, true); }
void Awake() { carObjectPool = EZObjectPool.CreateObjectPool(carPrefab, "Cars", carPoolsize, true, true, true); bicycleObjectPool = EZObjectPool.CreateObjectPool(bicyclePrefab, "Bicycles", bicyclePoolsize, true, true, true); trainObjectPool = EZObjectPool.CreateObjectPool(trainPrefab, "Trains", trainPoolsize, true, true, true); busObjectPool = EZObjectPool.CreateObjectPool(busPrefab, "Busses", busPoolsize, true, true, true); pedestrianObjectPool = EZObjectPool.CreateObjectPool(pedestrianPrefab, "Pedestrians", pedestrianPoolsize, true, true, true); }
private void Awake() { objectPool = EZObjectPool.CreateObjectPool(cubovirtual, "Objetos", 300, true, true, false); layer = LayerMask.GetMask("Terreno"); if (valorx == null) { valorx = GameObject.Find("X_valor").GetComponent <InputField>(); } if (valory == null) { valory = GameObject.Find("Y_valor").GetComponent <InputField>(); } if (valorz == null) { valorz = GameObject.Find("Z_valor").GetComponent <InputField>(); } x_value = int.Parse(valorx.text); y_value = int.Parse(valory.text); z_value = int.Parse(valorz.text); if (int1 == null) { int1 = GameObject.Find("primerint").GetComponent <InputField>(); } if (int2 == null) { int2 = GameObject.Find("segundoint").GetComponent <InputField>(); } if (int3 == null) { int3 = GameObject.Find("tercerint").GetComponent <InputField>(); } if (int4 == null) { int4 = GameObject.Find("cuartoint").GetComponent <InputField>(); } if (int5 == null) { int5 = GameObject.Find("quintoint").GetComponent <InputField>(); } int1_value = int.Parse(int1.text); int2_value = int.Parse(int2.text); int3_value = int.Parse(int3.text); int4_value = int.Parse(int4.text); int5_value = int.Parse(int5.text); /* * //cubo invisible que esta al medio por si lo necesito * poscuboinvisible = new Vector3((x_value / 2) + xinicio, 500, (y_value / 2) + zinicio); * RaycastHit rayocuboinvisible; * if (Physics.Raycast(poscuboinvisible, Vector3.down, out rayocuboinvisible, 300, layer)) * { * poscuboinvisible.y = rayocuboinvisible.point.y + 0.5f; * } * * cuboInvisible = Instantiate(cuboinvisible, poscuboinvisible, Quaternion.identity);//el y es arbitrario */ }
private void GeneratePools() { bulletsPool = EZObjectPool.CreateObjectPool(shootPrefab, "Shoot1", 20, true, true, true); bombsPool = EZObjectPool.CreateObjectPool(bombPrefab, "Bombs", 1, true, true, true); bombEffectPool = EZObjectPool.CreateObjectPool(bombEffectPrefab, "BombEffect", 1, true, true, true); hitsPool = EZObjectPool.CreateObjectPool(hitPrefab, "HitEffect", 6, true, true, true); breakingBarrelsPool = EZObjectPool.CreateObjectPool(breakingBarrelPrefab, "BreakingBarrels", 2, true, true, true); barrelsPool = EZObjectPool.CreateObjectPool(barrelPrefab, "Barrels", 6, true, true, true); }
private void Awake() { //Debug.Log("Running"); //if (objectPool == null) //{ objectPool = EZObjectPool.CreateObjectPool(dragIndicatorPrefab, "DraggableSpritePools", 5, true, true, true); //} //objectPool.InstantiatePool(); }
// Use this for initialization private void Awake() { objectPool = EZObjectPool.CreateObjectPool(itemIndicatorPrefab, "DropZoneObjectPool", 5, true, true, true); //if (!instance) //{ instance = this; //DontDestroyOnLoad(gameObject); //} }
void SetBulletsPool(int level) { if (level > GameManager.Instance.tablesEtc.disparosJugador.Count - 1) { return; } playerShots?.ClearPool(); var newShotPrefab = GameManager.Instance.tablesEtc.disparosJugador[level]; playerShots = EZObjectPool.CreateObjectPool(newShotPrefab, "PlayerShots" + level, 15, true, true, true); }
private void Awake() { //if (instance != null && instance != this) //{ // Destroy(this.gameObject); // return; //} //DontDestroyOnLoad(this.gameObject); instance = this; objectPool = EZObjectPool.CreateObjectPool(mixButtonPrefab, "simulationContextButton", 2, true, true, true); contextMenuPanel.SetActive(false); }
/// <summary> /// Sets up this effect's object pool. The pool will only be set up on the first call to this method, so calling it multiple times is safe. /// </summary> public void SetupPool() { if (tracerEffectPool == null) { tracerEffectPool = EZObjectPool.CreateObjectPool(Template.gameObject, Template.name, PoolSize, false, true, true); if (ConsistentShowing) { countLimit = (int)(1 / ChanceToShow); currCount = 1; } } }
void Inicializar() { //Object Poll de los disparos iniciales disparosPool = EZObjectPool.CreateObjectPool(disparoJugador, "Disparos Jugador", 10, true, true, false); //Inicializar puntos de disparo Transform transformPadre = transform.Find("PuntosDisparo").transform; cantidadPuntosDisparo = transformPadre.childCount; puntosDisparo = new Transform[cantidadPuntosDisparo]; for (var x = 0; x < cantidadPuntosDisparo; x++) { puntosDisparo[x] = transformPadre.GetChild(x); } }
// Use this for initialization void Start() { target = GameObject.Find("Player"); //enemyColor = Random.Range(0, 2); switch (enemyColor) { case 0: GetComponent <Renderer>().material.color = Color.red; redBulletPool = EZObjectPool.CreateObjectPool(redBulletPrefab, "Red Enemy Bullets", 100, true, true, true); break; case 1: GetComponent <Renderer>().material.color = Color.yellow; yellowBulletPool = EZObjectPool.CreateObjectPool(yellowBulletPrefab, "Yellow Enemy Bullets", 100, true, true, true); break; case 2: GetComponent <Renderer>().material.color = Color.blue; blueBulletPool = EZObjectPool.CreateObjectPool(blueBulletPrefab, "Blue Enemy Bullets", 100, true, true, true); break; } }
private void Awake() { objectPool = EZObjectPool.CreateObjectPool(buttonPreFab, "simulationPanelButton", 5, true, true, true); }
void Initialize() { defaultPosEnemies = enemiesT.localPosition; enemiesAnimator = enemiesT.parent.GetComponent <Animator>(); explosionsPool = EZObjectPool.CreateObjectPool(explosionPrefab, "Explosiones", 12, true, true, true); }
private void Awake() { minionPool = EZObjectPool.CreateObjectPool(minionPrefab, "MinionPool", 20, true, true, true); }
private void Awake() { zombiePool = EZObjectPool.CreateObjectPool(zombiePrefab, "ZombiePool", 20, true, true, true); }
void Start() { objectPool = EZObjectPool.CreateObjectPool(template, "Spawner", 600, false, true, true); }
private void Start() { objectPool = EZObjectPool.CreateObjectPool(buttonPrefab, "MusicButtonSpawner", 10, true, true, false); StartCoroutine(GenerateButtons()); }