public void Clear(PoolSystem poolSystem) { if (poolSystem != null && poolSystem.poolObjects.Count > 0 && poolSystem.poolObjects != null) { poolSystem.poolObjects.ForEach(t => t.Hide()); } }
private void Shoot() { //creates a spawn of the laser to the player position //Quaternion.identity-->default position //sets the laser to the player position above with no rotation //countdown on laser so player is not spaming if (Time.time > _nextFire) { //setting triple shot if (canTripleShot == true) { //Play FX! audioController.PlaySound(Sounds.tripleShotLaserSound); Instantiate(_tripleShotPrefab, _transform.position, Quaternion.identity); } else { //Play FX! audioController.PlaySound(Sounds.laserSound); //instanciamos el laser del player mediante Poolsystem PoolSystem.SpawnObject(_laserPrefab, PoolTypes.laserPlayer, _transform.position + new Vector3(0, 0.9f, 0)); //Instantiate(_laserPrefab, _transform.position + new Vector3(0, 0.9f, 0), Quaternion.identity); } _nextFire = Time.time + _fireRate; } }
private void Awake() { PoolSystem.InitiliazePool(_hitPrefabVFX, null, _poolSize); PoolSystem.InitiliazePool(_explositionVFX, null, _poolSize); PoolSystem.InitiliazePool(_deathDefaultPrefabVFX, null, _poolSize); PoolSystem.InitiliazePool(_bulletTrailVFX, null, _poolSize); }
// Use this for initialization void Start() { trackedObject = viveCntrl.GetComponent <SteamVR_TrackedObject>(); m_Pool = PoolSystem.FindPool("Projectile"); g_Pool = PoolSystem.FindPool("Grenade"); m_Stock = GetComponentInChildren <StockAttributes>(); m_Barrel = GetComponentInChildren <BarrelAttributes>(); activeBarrelList.Add(m_BarrelParts[0]); activeStockList.Add(m_StockParts[0]); m_BarrelIndex = 0; m_StockIndex = 0; //manager = GetComponentInChildren<PartManager>(); Commander = GetComponent <SquadCommand>(); aSource = GetComponent <AudioSource>(); isShooting = false; m_Ammunition = 200; m_Part = Part.Barrel; m_StateMachine = WeaponState.Weapon; reset = false; resetParts = true; feedback.enabled = false; }
private IEnumerator Burst(float _killTime) { for (int i = 0; i < 3; i++) { if (m_PaintballPool == null) { m_PaintballPool = PoolSystem.FindPool("Projectile"); } GameObject burst = m_PaintballPool.m_NextObject; burst.transform.position = m_Gun.position; burst.transform.rotation = m_Gun.rotation; burst.SetActive(true); float accuracy = 2.5f; CalculateAccuracy(ref burst, accuracy); int randomSound = Random.Range(0, fireClips.Length); aSource.PlayOneShot(fireClips[randomSound]); burst.GetComponent <Rigidbody>().AddForce(burst.transform.forward * m_Force); burst.GetComponent <Projectile>().SetOwner(gameObject, (CompareTag(GameManager.TeamEnum.Blue.ToString())) ? GameManager.TeamEnum.Blue : GameManager.TeamEnum.Red); yield return(new WaitForSeconds(BURST_FIRE_RATE)); } yield return(null); }
void Awake() { if (instance == null) { instance = this; } }
public GameObject InstantiateSceneObject(string prefabId, Vector3 position, Quaternion rotation) { GameObject go = PoolSystem.Spawn(prefabId); go.transform.position = position; go.transform.rotation = rotation; return(go); }
public void SpawnBulletTrailVFX(Vector3 start, Vector3 end) { var bulletTrail = PoolSystem.GetInstance <LineRenderer>(_bulletTrailVFX); bulletTrail.SetPosition(0, start); bulletTrail.SetPosition(1, end); bulletTrail.gameObject.SetActive(true); }
public static void Cull(string poolName, bool smartCull) { PoolSystem P = GetPoolByName(poolName); if (P) { P.Cull(); } }
public static void Prepare(string poolName) { PoolSystem P = GetPoolByName(poolName); if (P != null) { P.Prepare(); } }
public static void DespawnAllItems(string poolName) { PoolSystem P = GetPoolByName(poolName); if (P != null) { P.DespawnAllItems(); } }
void Awake() { if (_instance != null) { Destroy(gameObject); return; } _instance = this; }
void Awake() { Instance = this; foreach (var prefab in StartPrefabs) { Instantiate(prefab); } PoolSystem.Create(); }
private void Awake() { if (null != sInstance && this != sInstance) { Destroy(this.gameObject); } sInstance = this; DontDestroyOnLoad(this.gameObject); }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; } }
public void LaserMovement() { //sets the movement from the laser and when it goes off the map the game object is destroyed transform.Translate(Vector3.up * _speed * Time.deltaTime); //Si el laser sale de pantalla lo añadimos al pooling if (transform.position.y > 6.0f || transform.position.y < -6.0f) { PoolSystem.AddElementToPool(laserType, gameObject); } //Destroy(this.gameObject); }
void Shoot() { if (Time.time > nextFire) { //Play FX! audioController.PlaySound(Sounds.laserSound); //se spawnea el objeto des del pool system PoolSystem.SpawnObject(laserPrefab, weaponType, laserSpawn.position, transform.rotation); //Instantiate(laserPrefab, laserSpawn.position,transform.rotation); nextFire = Time.time + shootingRate; } }
private void Spawn() { var poolableGamObj = PoolSystem.FetchAvailable <CubePoolable>("Cube", out CubePoolable poolable); if (poolable != null) { var pos = poolableGamObj.transform.position; pos.x += Random.Range(-spawnRange.x, spawnRange.x); pos.y += Random.Range(-spawnRange.y, spawnRange.y); pos.z += Random.Range(-spawnRange.z, spawnRange.z); poolableGamObj.transform.position = pos; poolable.Aquire(); } }
public static void Kill(GameObject item) { if (item) { PoolSystem P = GetPoolByItem(item); if (P != null) { P.KillItem(item); } else { GameObject.Destroy(item); } } }
public void OnCollisionEnter2D(Collision2D collision) { // Destroy(this.gameObject); PoolSystem.AddElementToPool(laserType, gameObject); //accedemos al componente health, mediante collision, del objeto colisionado Health health = collision.gameObject.GetComponent <Health>(); if (health != null)//Control de seguridad health != null { health.Damage(1); } }
private void Shoot() { if (PoolSystem.TryFetchAvailable("Bullet", out Bullet bullet)) { bullet.transform.position = emissionSpot.position; bullet.Fire(emissionSpot.forward * shootForce, range); _lastTimeShot = Time.time; _bulletsInClip--; _state = WeaponState.Shooting; } else { Debug.Log("no more bullets available in pool"); } }
public void PlaySFXSource(AudioClip clip, Vector3 hitPosition, Vector3 normal) { if (clip) { var source = PoolSystem.GetInstance <AudioSource>(_sfxSource); float pitch = Random.Range(0.8f, 1.2f); source.gameObject.transform.position = hitPosition; source.gameObject.transform.forward = normal; source.gameObject.SetActive(true); source.pitch = pitch; source.PlayOneShot(clip); } }
public PoolObject Create(PoolSystem poolSystem, Transform parent) { PoolObject nonTakenObject = null; if (poolSystem.poolObjects != null && poolSystem.poolObjects.Count > 0) { nonTakenObject = poolSystem.poolObjects.FirstOrDefault(t => t.inUse == false); if (nonTakenObject == null) { nonTakenObject = GameObject.Instantiate(poolSystem.poolObject); poolSystem.poolObjects.Add(nonTakenObject); } } nonTakenObject.Create(parent); return(nonTakenObject); }
public static GameObject SpawnObject(GameObject prefab, PoolTypes type, Vector2 position) { //Buscamos un objeto de ese tipo en el pool GameObject spawnObject = PoolSystem.GetElement(type); //Si no hay ninguno lo creamos if (spawnObject == null) { spawnObject = Instantiate(prefab); } //Lo posicionamos en el spwnpoint y lo activamos spawnObject.transform.position = position; spawnObject.SetActive(true); return(spawnObject); }
protected override void Awake() { //Initiliaze projectil pool PoolSystem.InitiliazePool(_projectilPrefab, null, 1); //Get controller components from scene _vfxController = FindObjectOfType <VFXControllerComponent>(); _cameraController = FindObjectOfType <CameraControllerComponent>(); _weaponHolderController = FindObjectOfType <WeaponHolderComponent>(); //Get the player transform from the root of this object _playerForward = transform.root; //Stop update method enabled = false; base.Awake(); }
public override void Fire() { if (CanFire() && _anim.CanReloadOrFire()) { var projectil = PoolSystem.GetInstance <ProjectilComponent>(_projectilPrefab); Vector3 startPosition = GetMuzzleEndPosition(_cameraController.GetMainCamera(), _cameraController.GetWeaponCamera()); projectil.Launcher(ExplositionVFX, startPosition, _muzzleEnd.rotation, _playerForward.forward, _throwForce, _damage); ClipAmmo--; base.Fire(); } //Start call update method enabled = true; }
void Start() { Application.runInBackground = true; s_instance = this; player_pool = new PoolSystem <GameObject>(ResourcesLoader.LoadResources <GameObject>("Prefabs/Player_model"), 4); bomb_pool = new PoolSystem <GameObject>(ResourcesLoader.LoadResources <GameObject>("Prefabs/Bomb"), 100); pwr_up_pool = new PoolSystem <GameObject>(ResourcesLoader.LoadResources <GameObject>("Prefabs/PowerUp"), 100); hud = GameObject.Find("HUD").GetComponent <HUD>(); m_MainCamera = GameObject.Find("MainCamera"); mainMenu = GameObject.Find("OrthoCamera").GetComponent <MainMenuScript>(); mp = GameObject.Find("MusicPlayer").GetComponent <MusicPlayer>(); endmenu = GameObject.Find("EndMenu").GetComponent <EndMenu>(); baseRotation = m_MainCamera.transform.rotation; gravityStates = new Vector3[] { Vector3.up *const_gravity, Vector3.forward *const_gravity, Vector3.forward * -const_gravity, Vector3.right *const_gravity, Vector3.right * -const_gravity }; }
void Init() { pathTime = animTime = 0; rotationDir = RallyPos = PosMem = storedPos = Vector3.zero; nameCheckPoint = GameObject.Find("NameCheck").GetComponent <Collider>(); rifle = GetComponentInChildren <FindRifle>().gameObject; anim = GetComponentInChildren <Animator>(); aSource = GetComponent <AudioSource>(); visibleObjects = new List <GameObject>(); nameReady = false; //Get Components m_SkinRenderer = GetComponentInChildren <SkinnedMeshRenderer>(); m_HealthManager = GetComponentInChildren <HealthManager>(); m_NavAgent = GetComponent <UnityEngine.AI.NavMeshAgent>(); m_NavAgent.updateRotation = false; m_Camera = GetComponentInChildren <Camera>(); m_PaintballPool = PoolSystem.FindPool("Projectile"); //set the health according to what enemy type it is if (isLeader) { m_HealthManager.SetEntityToMinionLeader(); transform.localScale = new Vector3(0.75f, 0.75f, 0.75f); } else { m_HealthManager.SetEntityToMinion(); } currentState = States.Patrol; //set things to false SwitchOff(); //set things to zero gunTimer = targetLockTimer = pathTime = 0; //floats target = null; //precalculations m_FireRate = 60.0f / m_FireRate; sinTurn = Mathf.Sin(30.0f); cosTurn = Mathf.Cos(30.0f); }
public void Fire() { anim.SetBool("Attack", true); anim.SetBool("Walk", false); rifle.transform.LookAt(target.position); int randomSound; GameObject obj; Transform objTransform; if (isLeader) { StartCoroutine("Burst", KILL_TIME); } else { if (m_PaintballPool == null) { m_PaintballPool = PoolSystem.FindPool("Projectile"); } obj = m_PaintballPool.m_NextObject; if (obj == null) { return; } objTransform = obj.transform; objTransform.position = m_Gun.position; objTransform.rotation = m_Gun.rotation; obj.SetActive(true); randomSound = Random.Range(0, fireClips.Length); if (fireClips[randomSound] != null) { aSource.PlayOneShot(fireClips[randomSound]); } obj.GetComponent <Rigidbody>().AddForce(m_Gun.forward * m_Force); obj.GetComponent <Projectile>().SetOwner(gameObject, (CompareTag(GameManager.TeamEnum.Blue.ToString())) ? GameManager.TeamEnum.Blue : GameManager.TeamEnum.Red); } }
private void Awake() { poolSystem = PoolSystem.Instance; }
// Use this for initialization void Start () { manager = this; gameObject.AddComponent<PoolSystem>(); bulletPool = gameObject.GetComponent<PoolSystem>(); bulletPool.Initialize(poolSize, bulletPrefab); spriteList = Resources.LoadAll<Sprite>("EnemyBullets/Shots"); bulletMats = new Material[] { Resources.Load<Material>("EnemyBullets/DefaultBullet"), Resources.Load<Material>("EnemyBullets/AdditiveBlendBullet") }; // Suffering (Determines bullet sprite number, hitbox, additive blend state, animation, then associates those properties with the enum) propertyList = new Dictionary<BulletType, BulletTypeProperties>(); propertyList.Add(BulletType.RedDot, new BulletTypeProperties(95, 4, false, null)); propertyList.Add(BulletType.RedDarkDot, new BulletTypeProperties(92, 4, false, null)); propertyList.Add(BulletType.RedShard, new BulletTypeProperties(101, 4, false, null)); propertyList.Add(BulletType.RedArrow, new BulletTypeProperties(84, 4, false, null)); propertyList.Add(BulletType.RedDarkArrow, new BulletTypeProperties(89, 4, false, null)); propertyList.Add(BulletType.RedCrawler, new BulletTypeProperties(87, 4, false, spriteListSection(87, 2))); propertyList.Add(BulletType.RedFire, new BulletTypeProperties(96, 4, true, spriteListSection(96, 4))); propertyList.Add(BulletType.YellowDot, new BulletTypeProperties(129, 4, false, null)); propertyList.Add(BulletType.YellowDarkDot, new BulletTypeProperties(126, 4, false, null)); propertyList.Add(BulletType.YellowShard, new BulletTypeProperties(135, 4, false, null)); propertyList.Add(BulletType.YellowArrow, new BulletTypeProperties(118, 4, false, null)); propertyList.Add(BulletType.YellowDarkArrow, new BulletTypeProperties(123, 4, false, null)); propertyList.Add(BulletType.YellowCrawler, new BulletTypeProperties(121, 4, false, spriteListSection(121, 2))); propertyList.Add(BulletType.YellowFire, new BulletTypeProperties(130, 4, true, spriteListSection(130, 4))); propertyList.Add(BulletType.GreenDot, new BulletTypeProperties(45, 4, false, null)); propertyList.Add(BulletType.GreenDarkDot, new BulletTypeProperties(42, 4, false, null)); propertyList.Add(BulletType.GreenShard, new BulletTypeProperties(47, 4, false, null)); propertyList.Add(BulletType.GreenArrow, new BulletTypeProperties(34, 4, false, null)); propertyList.Add(BulletType.GreenDarkArrow, new BulletTypeProperties(39, 4, false, null)); propertyList.Add(BulletType.GreenCrawler, new BulletTypeProperties(37, 4, false, spriteListSection(37, 2))); propertyList.Add(BulletType.CyanDot, new BulletTypeProperties(30, 4, false, null)); propertyList.Add(BulletType.CyanDarkDot, new BulletTypeProperties(27, 4, false, null)); propertyList.Add(BulletType.CyanShard, new BulletTypeProperties(32, 4, false, null)); propertyList.Add(BulletType.CyanArrow, new BulletTypeProperties(19, 4, false, null)); propertyList.Add(BulletType.CyanDarkArrow, new BulletTypeProperties(24, 4, false, null)); propertyList.Add(BulletType.CyanCrawler, new BulletTypeProperties(22, 4, false, spriteListSection(22, 2))); propertyList.Add(BulletType.BlueDot, new BulletTypeProperties(11, 4, false, null)); propertyList.Add(BulletType.BlueDarkDot, new BulletTypeProperties(8, 4, false, null)); propertyList.Add(BulletType.BlueShard, new BulletTypeProperties(17, 4, false, null)); propertyList.Add(BulletType.BlueArrow, new BulletTypeProperties(0, 4, false, null)); propertyList.Add(BulletType.BlueDarkArrow, new BulletTypeProperties(5, 4, false, null)); propertyList.Add(BulletType.BlueCrawler, new BulletTypeProperties(3, 4, false, spriteListSection(3, 2))); propertyList.Add(BulletType.BlueFire, new BulletTypeProperties(12, 4, true, spriteListSection(12, 4))); propertyList.Add(BulletType.PurpleDot, new BulletTypeProperties(76, 4, false, null)); propertyList.Add(BulletType.PurpleDarkDot, new BulletTypeProperties(73, 4, false, null)); propertyList.Add(BulletType.PurpleShard, new BulletTypeProperties(82, 4, false, null)); propertyList.Add(BulletType.PurpleArrow, new BulletTypeProperties(65, 4, false, null)); propertyList.Add(BulletType.PurpleDarkArrow, new BulletTypeProperties(70, 4, false, null)); propertyList.Add(BulletType.PurpleCrawler, new BulletTypeProperties(68, 4, false, spriteListSection(68, 2))); propertyList.Add(BulletType.PurpleFire, new BulletTypeProperties(77, 4, true, spriteListSection(77, 4))); propertyList.Add(BulletType.PinkDot, new BulletTypeProperties(61, 4, false, null)); propertyList.Add(BulletType.PinkDarkDot, new BulletTypeProperties(58, 4, false, null)); propertyList.Add(BulletType.PinkShard, new BulletTypeProperties(63, 4, false, null)); propertyList.Add(BulletType.PinkArrow, new BulletTypeProperties(50, 4, false, null)); propertyList.Add(BulletType.PinkDarkArrow, new BulletTypeProperties(55, 4, false, null)); propertyList.Add(BulletType.PinkCrawler, new BulletTypeProperties(68, 4, false, spriteListSection(68, 2))); propertyList.Add(BulletType.WhiteDot, new BulletTypeProperties(114, 4, false, null)); propertyList.Add(BulletType.WhiteDarkDot, new BulletTypeProperties(111, 4, false, null)); propertyList.Add(BulletType.WhiteShard, new BulletTypeProperties(116, 4, false, null)); propertyList.Add(BulletType.WhiteArrow, new BulletTypeProperties(103, 4, false, null)); propertyList.Add(BulletType.WhiteDarkArrow, new BulletTypeProperties(108, 4, false, null)); propertyList.Add(BulletType.WhiteCrawler, new BulletTypeProperties(106, 4, false, spriteListSection(106, 2))); propertyList.Add(BulletType.RedOrb, new BulletTypeProperties(100, 16, false, null)); propertyList.Add(BulletType.RedDarkOrb, new BulletTypeProperties(93, 16, false, null)); propertyList.Add(BulletType.RedWave, new BulletTypeProperties(102, 16, false, null)); propertyList.Add(BulletType.RedDarkWave, new BulletTypeProperties(94, 16, false, null)); propertyList.Add(BulletType.RedBlade, new BulletTypeProperties(85, 16, false, null)); propertyList.Add(BulletType.RedDarkBlade, new BulletTypeProperties(90, 16, false, null)); propertyList.Add(BulletType.YellowOrb, new BulletTypeProperties(134, 16, false, null)); propertyList.Add(BulletType.YellowDarkOrb, new BulletTypeProperties(127, 16, false, null)); propertyList.Add(BulletType.YellowWave, new BulletTypeProperties(136, 16, false, null)); propertyList.Add(BulletType.YellowDarkWave, new BulletTypeProperties(128, 16, false, null)); propertyList.Add(BulletType.YellowBlade, new BulletTypeProperties(119, 16, false, null)); propertyList.Add(BulletType.YellowDarkBlade, new BulletTypeProperties(124, 16, false, null)); propertyList.Add(BulletType.GreenOrb, new BulletTypeProperties(46, 16, false, null)); propertyList.Add(BulletType.GreenDarkOrb, new BulletTypeProperties(43, 16, false, null)); propertyList.Add(BulletType.GreenWave, new BulletTypeProperties(48, 16, false, null)); propertyList.Add(BulletType.GreenDarkWave, new BulletTypeProperties(44, 16, false, null)); propertyList.Add(BulletType.GreenBlade, new BulletTypeProperties(35, 16, false, null)); propertyList.Add(BulletType.GreenDarkBlade, new BulletTypeProperties(40, 16, false, null)); propertyList.Add(BulletType.CyanOrb, new BulletTypeProperties(31, 16, false, null)); propertyList.Add(BulletType.CyanDarkOrb, new BulletTypeProperties(28, 16, false, null)); propertyList.Add(BulletType.CyanWave, new BulletTypeProperties(33, 16, false, null)); propertyList.Add(BulletType.CyanDarkWave, new BulletTypeProperties(29, 16, false, null)); propertyList.Add(BulletType.CyanBlade, new BulletTypeProperties(20, 16, false, null)); propertyList.Add(BulletType.CyanDarkBlade, new BulletTypeProperties(25, 16, false, null)); propertyList.Add(BulletType.BlueOrb, new BulletTypeProperties(16, 16, false, null)); propertyList.Add(BulletType.BlueDarkOrb, new BulletTypeProperties(9, 16, false, null)); propertyList.Add(BulletType.BlueWave, new BulletTypeProperties(18, 16, false, null)); propertyList.Add(BulletType.BlueDarkWave, new BulletTypeProperties(10, 16, false, null)); propertyList.Add(BulletType.BlueBlade, new BulletTypeProperties(1, 16, false, null)); propertyList.Add(BulletType.BlueDarkBlade, new BulletTypeProperties(6, 16, false, null)); propertyList.Add(BulletType.PurpleOrb, new BulletTypeProperties(81, 16, false, null)); propertyList.Add(BulletType.PurpleDarkOrb, new BulletTypeProperties(74, 16, false, null)); propertyList.Add(BulletType.PurpleWave, new BulletTypeProperties(83, 16, false, null)); propertyList.Add(BulletType.PurpleDarkWave, new BulletTypeProperties(75, 16, false, null)); propertyList.Add(BulletType.PurpleBlade, new BulletTypeProperties(66, 16, false, null)); propertyList.Add(BulletType.PurpleDarkBlade, new BulletTypeProperties(71, 16, false, null)); propertyList.Add(BulletType.PinkOrb, new BulletTypeProperties(62, 16, false, null)); propertyList.Add(BulletType.PinkDarkOrb, new BulletTypeProperties(74, 16, false, null)); propertyList.Add(BulletType.PinkWave, new BulletTypeProperties(64, 16, false, null)); propertyList.Add(BulletType.PinkDarkWave, new BulletTypeProperties(60, 16, false, null)); propertyList.Add(BulletType.PinkBlade, new BulletTypeProperties(51, 16, false, null)); propertyList.Add(BulletType.PinkDarkBlade, new BulletTypeProperties(56, 16, false, null)); propertyList.Add(BulletType.WhiteOrb, new BulletTypeProperties(115, 16, false, null)); propertyList.Add(BulletType.WhiteDarkOrb, new BulletTypeProperties(112, 16, false, null)); propertyList.Add(BulletType.WhiteWave, new BulletTypeProperties(117, 16, false, null)); propertyList.Add(BulletType.WhiteDarkWave, new BulletTypeProperties(113, 16, false, null)); propertyList.Add(BulletType.WhiteBlade, new BulletTypeProperties(104, 16, false, null)); propertyList.Add(BulletType.WhiteDarkBlade, new BulletTypeProperties(109, 16, false, null)); propertyList.Add(BulletType.RedBubble, new BulletTypeProperties(86, 64, false, null)); propertyList.Add(BulletType.RedDarkBubble, new BulletTypeProperties(91, 64, false, null)); propertyList.Add(BulletType.YellowBubble, new BulletTypeProperties(120, 64, false, null)); propertyList.Add(BulletType.YellowDarkBubble, new BulletTypeProperties(125, 64, false, null)); propertyList.Add(BulletType.GreenBubble, new BulletTypeProperties(36, 64, false, null)); propertyList.Add(BulletType.GreenDarkBubble, new BulletTypeProperties(41, 64, false, null)); propertyList.Add(BulletType.CyanBubble, new BulletTypeProperties(21, 64, false, null)); propertyList.Add(BulletType.CyanDarkBubble, new BulletTypeProperties(26, 64, false, null)); propertyList.Add(BulletType.BlueBubble, new BulletTypeProperties(2, 64, false, null)); propertyList.Add(BulletType.BlueDarkBubble, new BulletTypeProperties(7, 64, false, null)); propertyList.Add(BulletType.PurpleBubble, new BulletTypeProperties(67, 64, false, null)); propertyList.Add(BulletType.PurpleDarkBubble, new BulletTypeProperties(72, 64, false, null)); propertyList.Add(BulletType.PinkBubble, new BulletTypeProperties(52, 64, false, null)); propertyList.Add(BulletType.PinkDarkBubble, new BulletTypeProperties(57, 64, false, null)); propertyList.Add(BulletType.WhiteBubble, new BulletTypeProperties(105, 64, false, null)); propertyList.Add(BulletType.WhiteDarkBubble, new BulletTypeProperties(110, 64, false, null)); }
// Use this for initialization void Start () { gameObject.AddComponent<PoolSystem>(); bulletPool = gameObject.GetComponent<PoolSystem>(); bulletPool.Initialize(poolSize, bulletPrefab); }