예제 #1
0
    /// <summary>
    /// Kills the missile and spawn an explosion
    /// </summary>
    public void KillMissile()
    {
        Vector3 pos = transform.position;

        pos.y += ExplosionYOffset;

        // Spawn the explosion (also kills this game object)
        explodable.SpawnExplosion(pos);
    }
예제 #2
0
    // Perform death cleanup
    void DoDie()
    {
        if (isDead)
        {
            return;
        }

        isDead = true;
        transform.SetParent(null);
        explodable.SpawnExplosion(transform.position, 0.075f);
    }