コード例 #1
0
    void OnTriggerEnter(Collider c)
    {
        iHitable script = c.GetComponent <iHitable>();

        if (script != null)
        {
            script.Hit((int)m_damage);
        }
        //Effect
        //
        Destroy(this.gameObject);
    }
コード例 #2
0
ファイル: CorrosiveEffect.cs プロジェクト: Sloth113/Subterror
 // 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);
     }
 }
コード例 #3
0
    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);
    }
コード例 #4
0
    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);
    }