Exemple #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>();
     }
 }
Exemple #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
                }
            }
        }
Exemple #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
                }
            }
        }
 void Start()
 {
     cam    = Camera.main;
     Status = MainBody.GetComponent <BreuDamageTake>();
 }
Exemple #5
0
 void Start()
 {
     Status = MainBody.GetComponent <BreuDamageTake>();
 }