// Use this for initialization void Awake() { DieEffectHash = VFXController.StringToHash("Smoke"); shootTime = shootCoolDown; contactFilter2D.layerMask = hitLayerMask; rayCastPosition = transform.position; bulletPool = BulletPool.GetObjectPool(Bullet, 10); animator = GetComponent <Animator>(); shootScript = Bullet.GetComponent <StartShooting>(); spriteRenderer = GetComponent <SpriteRenderer>(); updateHealthBar = GetComponentInChildren <UpdateHealthBar>(); }
private IEnumerator WaitToShoot() { yield return(new WaitForSeconds(1f)); Shooting.Play(); for (int i = 0; i < bulletObjects.Length; i++) { StartShooting startShooting = bulletObjects[i].instance.GetComponent <StartShooting>(); startShooting.direction = (targetToTrack.transform.position - bulletObjects[i].instance.transform.position).normalized; startShooting.speed = bulletSpeed; Debug.Log(bulletObjects[i].instance.GetComponent <StartShooting>().speed); } }