void OnTriggerEnter(Collider c) { iHitable script = c.GetComponent <iHitable>(); if (script != null) { script.Hit((int)m_damage); } //Effect // Destroy(this.gameObject); }
// Update is called once per frame void Update() { m_timer += Time.deltaTime; if (m_timer > m_damRate) { m_attached.Hit(m_damage); m_damRate += m_damRate; } if (m_timer > m_duration) { Destroy(m_spawn); Destroy(this); } }
void OnTriggerEnter(Collider c) { iHitable script = c.GetComponent <iHitable>(); if (script != null) { script.Hit((int)m_damage); } //Effect // if (m_corrsiveEffect != null && c.gameObject.GetComponent <iHitable>() != null) { c.gameObject.AddComponent <CorrosiveEffect>(); c.gameObject.GetComponent <CorrosiveEffect>().m_duration = m_corrosiveTime; c.gameObject.GetComponent <CorrosiveEffect>().m_damage = m_corrosiveDamage; c.gameObject.GetComponent <CorrosiveEffect>().m_effect = m_corrsiveEffect; } Destroy(this.gameObject); }
void OnTriggerEnter(Collider c) { iHitable script = c.GetComponent <iHitable>(); if (script != null) { script.Hit((int)m_damage); } //Effect // if (m_betterExplosion) { Instantiate <GameObject>(m_biggerExplosion, this.transform.position, this.transform.rotation); } else { Instantiate <GameObject>(m_explosion, this.transform.position, this.transform.rotation); } Destroy(this.gameObject); }