Exemple #1
0
 /// <summary>
 /// Shoots a bullet barrage of up to 10 buullets
 /// </summary>
 /// <returns></returns>
 IEnumerator BulletBarrage()
 {
     shotBullets = 0;
     if (bullet != null)
     {
         bullet.GetComponent <Bullet_Player>().ShootBullet();
         counter = 0;
     }
     for (int i = 0; i < barrageAmount; i++)
     {
         if (barrageAmount > i)
         {
             bullet            = Instantiate(bulletPrefab, transform.position, Quaternion.identity);
             bulletLight       = bullet.GetComponentInChildren <Light>();
             bulletLight.range = 1;
             counter           = 1;
             ShootSound();
             bullet.GetComponent <Bullet_Player>().ShootBullet();
             counter = 0;
             shotBullets++;
             BulletShot?.Invoke();
             bullet = null;
             yield return(new WaitForSeconds(.1f));
         }
     }
 }
Exemple #2
0
 private void OnBulletShot()
 {
     if (BulletShot != null)
     {
         BulletShot.Invoke();
     }
 }
Exemple #3
0
        // Use this for initialization
        void Start()
        {
            thisTransform = transform;
            ShootMe       = thisTransform.GetComponent <BulletShot>();
            Flame         = thisTransform.GetComponent <AudioSource>();

            ActiveDistance = Random.Range(-3, 2);
            ActiveSpeed    = Random.Range(5, 10);


            if (Managers.Game.PlayerPrefab != null)
            {
                playerTransform = Managers.Game.PlayerPrefab.transform;
            }

            StartCoroutine(CoUpdate());
        }
Exemple #4
0
    void OnTriggerEnter(Collider collider)
    {
        BulletShot bullet = collider.GetComponent <BulletShot>();

        if (bullet != null)
        {
            Debug.Log("Enemy destroyed");
            bullet.explore();
            GameObject obj = GameObject.Instantiate(miniCubes);
            obj.transform.position = transform.position - new Vector3(0, 0.25f, 0);
            Destroy(gameObject);
        }
        else if (collider.gameObject.name == "BaseTile")
        {
            Destroy(collider.gameObject);
        }
        else if (collider.gameObject.name == "Player")
        {
            Player.Instance.showMiniCubes();
            collider.gameObject.transform.position = new Vector3(0, 20f, 0);
            Player.Instance.fallDawn();
        }
    }
 void Start()
 {
     _shot = GetComponent<BulletShot>();
 }
Exemple #6
0
 private void Awake()
 {
     bulletShot = new BulletShot(this.transform.position);
 }
Exemple #7
0
 void Awake()
 {
     hp         = maxHp;
     bulletShot = GetComponent <BulletShot>();
 }
Exemple #8
0
 void Start()
 {
     _shot = GetComponent <BulletShot>();
 }