Exemplo n.º 1
0
    private void Shoot()
    {
        RedBullet newBullet = Instantiate(bullet, this.transform.position + new Vector3(1.0f, 0, 0), bullet.transform.rotation);

        newBullet.parent = gameObject;
        newBullet.Fire();
    }
Exemplo n.º 2
0
    /// <summary>
    /// OnTriggerEnter Unity Method
    /// Usable when DoorCell is get by an entity that deals damages.
    /// </summary>
    /// <param name="other">The entity that touch the DoorCell</param>
    private void OnTriggerEnter(Collider other)
    {
        if (other.GetComponent <RedBullet>())
        {
            RedBullet bullet = other.GetComponent <RedBullet>();

            doorHealth -= bullet.damage;
        }
    }
Exemplo n.º 3
0
 private void CheckForShooting()
 {
     if (shootingCooldown <= 0)
     {
         var b = new RedBullet(position);
         (b as RedBullet).SetTexture();
         bullets.Add(b);
         shootingCooldown = initialShootingCooldown;
     }
     else
     {
         shootingCooldown -= GameManager.DeltaTime;;
     }
 }
Exemplo n.º 4
0
    /// <summary>
    /// TakeDamage method.
    /// Usable when RedEnemy is get by an entity that deals damages.
    /// </summary>
    /// <param name="damage">The number of damage you want to Apply</param>
    /// <param name="bullet">The RedBullet that touch the RedEnemy</param>
    public void TakeDamage(int damage, RedBullet bullet)
    {
        if (bullet.type == type)
        {
            hp -= damage;
        }
        else
        {
            Debug.Log("Immune Asooooo");
        }

        if (hp <= 0)
        {
            BeKilled();
        }
    }
Exemplo n.º 5
0
 void Start()
 {
     bullet = Resources.Load <RedBullet>("RedBullet");
 }
Exemplo n.º 6
0
 // Start is called before the first frame update
 void Start()
 {
     redBullet   = gameObject.AddComponent <RedBullet>();
     blueBullet  = gameObject.AddComponent <BlueBullet>();
     gameManager = GameObject.Find("GameManager").GetComponent <GameManager>();
 }