Ejemplo n.º 1
0
    protected override void OnTriggerEnter(Collider other)
    {
        Component obj = other.attachedRigidbody != null ? (Component)other.attachedRigidbody : (Component)other;

        if (m_team == Team.Enemy)
        {
            //Debug.Log(DebugUtilities.AddTimestampPrefix(m_team + " Projectile '" + name + "' hit " + obj.tag + "!"), other);

            if (obj.tag == "Ground")
            {
                if (m_hitSFX != null)
                {
                    m_hitSFX.PlayAt(transform.position, Environment.AudioRoot);
                }

                Detonate();

                ScenarioManager.EndRound(false);
            }
            else if (obj.tag == "Player")
            {
                if (m_hitSFX != null)
                {
                    m_hitSFX.PlayAt(transform.position, Environment.AudioRoot);
                }

                Detonate();

                ScenarioManager.OnPlayerHit();
            }
            else if (obj.tag == "Fire")
            {
                OnDeath(true);
            }
        }
    }