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); }
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 (impactEffectPool == null) { impactEffectPool = EZObjectPool.CreateObjectPool(Template, 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); }
/// <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) 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); }
// 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); }
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 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 Start() { xPos = Random.Range(-RandomRange, RandomRange); yPos = Random.Range(-RandomRange, RandomRange); desiredPos = new Vector3(xPos, yPos, transform.position.z); bulletPool = GameObject.Find("Crab Bullets Pool").GetComponent <EZObjectPool>(); }
// Use this for initialization void Start() { pool = GetComponent <EZObjectPool>(); if (pool.TryGetNextObject(spawnPos[Mathf.RoundToInt(Random.Range(0, 8))].position, Quaternion.identity, out obj)) { obj.SetActive(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(); }
void Start() { xPos = Random.Range(-RandomRange, RandomRange); yPos = Random.Range(-RandomRange, RandomRange); desiredPos = new Vector3(xPos, yPos, transform.position.z); bulletPool = GameObject.Find("Batman Bullets Pool").GetComponent <EZObjectPool>(); target = FindObjectOfType <PlayerMovement>().transform; }
// Use this for initialization private void Awake() { objectPool = EZObjectPool.CreateObjectPool(itemIndicatorPrefab, "DropZoneObjectPool", 5, true, true, true); //if (!instance) //{ instance = this; //DontDestroyOnLoad(gameObject); //} }
private void Start() { InvokeRepeating("FindTarget", 0.01f, 1f); StartCoroutine(Shoot()); if (m_pool == null) { m_pool = FindObjectOfType <EZObjectPool>(); } }
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 Start() { vida = 100f; velocidadInicial = velocidadRotacion; mainCamera = Camera.main; bullets_pool = EZObjectPool.GetObjectPool("Bullets_1"); myStats = new Stats() { velocity = 30 + myBullet.stats.velocity }; active = 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 (tracerEffectPool == null) { tracerEffectPool = EZObjectPool.CreateObjectPool(Template.gameObject, Template.name, PoolSize, false, true, true); if (ConsistentShowing) { countLimit = (int)(1 / ChanceToShow); currCount = 1; } } }
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); }
void Start() { phase1 = true; phase2 = false; xPos = Random.Range(-RandomRange, RandomRange); yPos = Random.Range(-RandomRange, RandomRange); desiredPos = new Vector3(xPos, yPos, transform.position.z); bulletPool = GameObject.Find("Final Boss Bullets Pool").GetComponent <EZObjectPool>(); bulletGhostPool = GameObject.Find("Final Boss Ghost Bullets Pool").GetComponent <EZObjectPool>(); target = FindObjectOfType <PlayerMovement>().transform; }
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); } }
void Initialize() { spriteRenderer = GetComponent <SpriteRenderer>(); playerT = GameManager.Instance.player.transform; ID = transform.name.Split(' ')[1].Substring(0, 2); switch (bulletType) { case BulletType.FireBullet: myBulletPool = GameManager.Instance.enemyBulletsPoolFire; break; case BulletType.RedBullet: myBulletPool = GameManager.Instance.enemyBulletsPoolRed; break; default: myBulletPool = GameManager.Instance.enemyBulletsPoolGreen; break; } }
// 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; } }
void Start() { if(healthBarPool==null) { GameObject g = GameObject.Find ("HealthBars"); healthBarPool = g.GetComponent<EZObjectPool>(); } if(canvas==null) { canvas = GameObject.Find ("Canvas"); } GameObject eb = this.gameObject; healthBarPool.TryGetNextObject(Vector3.zero,Quaternion.identity,out eb); energyBar = eb.GetComponent<EnergyBar>(); energyBar.SetValueMax((int) health); // energyBar.transform.SetParent(canvas.transform); EnergyBarFollowObject guiBar = energyBar.GetComponent<EnergyBarFollowObject>(); guiBar.followObject = this.gameObject.transform.FindChild("BarPoint").gameObject; UnitFacade u = (UnitFacade) this.GetUnitFacade(); GameObject exit = GameObject.Find("CreepExit"); u.MoveTo(exit.transform.position,false); }
public void Start () { if(shot==null) { if(shotName=="") { shotName = "BulletPool"; } shot = GameObject.Find(shotName).GetComponent<EZObjectPool>(); } if (CheckErrors() == true) { return; } // find muzzle flash particle systems for (int f=0; f < exits.Length; f++) { if ( exits[f].transform.childCount == 1 ) { // check for child exits[f].flare = exits[f].transform.GetChild(0).gameObject; exits[f].particleComponent = exits[f].flare.GetComponent<ParticleSystem>(); exits[f].particleComponent.Stop(true); } } curInaccuracy = inaccuracy; // initialize // compute missing value: shotSpeed, maxRange, shotDuration if (shotSpeed <= 0) { shotSpeed = maxRange / shotDuration; } else if (maxRange <= 0) { maxRange = shotSpeed * shotDuration; } else { // compute shotDuration even if all 3 are set to keep math consistant shotDuration = maxRange / shotSpeed; } }
void Start() { bulletPool = GameObject.Find("Enemy Small Bullets Pool").GetComponent <EZObjectPool>(); rb = GetComponent <Rigidbody2D>(); target = FindObjectOfType <PlayerMovement>().transform; }
// Use this for initialization void Start() { pool = FindObjectOfType <EZObjectPool>(); }
// Use this for initialization void Start() { mailPool = GetComponent <EZObjectPool> (); dashboard.mailHeldChanged += renderMail; }
private void Awake() { minionPool = EZObjectPool.CreateObjectPool(minionPrefab, "MinionPool", 20, true, true, true); }
public void Start() { if(blastObjectPool==null) { blastObjectPool = GameObject.Find(blastObjectPoolName).gameObject.GetComponent<EZObjectPool>(); } }
private void Awake() { zombiePool = EZObjectPool.CreateObjectPool(zombiePrefab, "ZombiePool", 20, true, true, true); }