public void AddBullet() { idx++; BulletControler temp_con = new BulletControler(idx); this.CustomList.Add(temp_con); var temp = this.CustomList; this.CustomList = new List<BulletControler>(temp); }
public void AddBullet() { idx++; BulletControler temp_con = new BulletControler(idx); this.CustomList.Add(temp_con); var temp = this.CustomList; this.CustomList = new List <BulletControler>(temp); }
void Update() { if (isFiring) { shotCounter -= Time.deltaTime; if (shotCounter <= 0) { shotCounter = timeBetweenShots; BulletControler newBullet = Instantiate(bullet, firePoint.position, firePoint.rotation) as BulletControler; newBullet.setShooter(shooter); newBullet.transform.rotation = transform.rotation; } } else { shotCounter = 0; } }