Exemplo n.º 1
0
 /// <summary>
 /// checks if mainbody and health bar are not null, sets damagesource and foreground
 /// </summary>
 void Start()
 {
     if (MainBody != null)
     {
         DamageSource = MainBody.GetComponent <BreuDamageTake>();
     }
     if (HealthBar != null)
     {
         Foreground = HealthBar.GetComponent <Image>();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// does damage to actors tagged "BreuPlayer" when colliders enter eachother
        /// </summary>
        void OnTriggerEnter(Collider col)
        {
            BreuDamageTake DT = col.GetComponent <BreuDamageTake>();

            if (col.gameObject.tag == "BreuPlayer")
            {
                if (DT != null)
                {
                    DT.TakeDamage(Damage);//damages object
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// does damage to actors not tagged "BreuPlayer" when colliders enter eachother
        /// </summary>
        void OnTriggerEnter(Collider col)
        {
            BreuDamageTake DT = col.GetComponent <BreuDamageTake>();

            if (col.gameObject.tag != "BreuPlayer")
            {
                if (DT != null)
                {
                    DT.TakeDamage(Damage);//damages object
                }

                if (DisappearsOnHit == true)
                {
                    Destroy(gameObject);//destorys bullet if it should disappear on hit
                }
            }
        }
Exemplo n.º 4
0
 void Start()
 {
     cam    = Camera.main;
     Status = MainBody.GetComponent <BreuDamageTake>();
 }
Exemplo n.º 5
0
 void Start()
 {
     Status = MainBody.GetComponent <BreuDamageTake>();
 }