示例#1
0
    public void FireAndExplode()
    {
        Rigidbody      shellInstance  = Instantiate(m_Shell, m_FireTransform.position, m_FireTransform.rotation) as Rigidbody;
        ShellExplosion shellExplosion = shellInstance.GetComponent <ShellExplosion>();

        shellExplosion.Explode(15.0f);
    }
示例#2
0
    private void BlowUp()
    {
        ShellExplosion currentExplosion = Instantiate(explosion, transform.position, Quaternion.identity);

        currentExplosion.Explode(explosionForce, explosionRadius);
        Destroy(currentExplosion.gameObject, 3f);
        Destroy(gameObject);
    }
示例#3
0
    private void OnCollisionEnter(Collision collision)
    {
        ParticleSystem particles = GetComponentInChildren <ParticleSystem>();

        particles.transform.parent = null;
        Destroy(particles.gameObject, 1f);

        ShellExplosion currentExplosion = Instantiate(explosion, transform.position, Quaternion.identity);

        Destroy(currentExplosion.gameObject, 3f);
        currentExplosion.Explode(explosionForce, explosionRadius);
        Destroy(gameObject);
    }
示例#4
0
    private void OnCollisionEnter(Collision collision)
    {
        Rigidbody rb = collision.gameObject.GetComponent <Rigidbody>();

        if (collision.gameObject.GetComponent <Rigidbody>() != null)
        {
            if (rb.velocity.magnitude + velocity > forceToExplode)
            {
                ShellExplosion currentExplosion = Instantiate(explosion, transform.position, transform.rotation);
                currentExplosion.Explode(explosionForce, explosionRadius);
                Destroy(currentExplosion.gameObject, 5f);
                Destroy(gameObject);
            }
        }
    }
示例#5
0
    private void OnCollisionEnter(Collision collision)
    {
        if (ai != null)
        {
            ai.SetProjectileTime(totalFlightTime);
        }
        ShellExplosion thisExplosion = Instantiate(explosion, explosionPoint.position, explosionPoint.rotation);

        Destroy(thisExplosion.gameObject, 5f);
        if (ai != null)
        {
            thisExplosion.SetExplosionFromAI();
        }
        thisExplosion.Explode(explosionForce, explosionRadius);
        Destroy(gameObject);
    }