Ejemplo n.º 1
0
    // Token: 0x06001126 RID: 4390 RVA: 0x00068634 File Offset: 0x00066834
    public Vector3 Explode()
    {
        Vector3 result = Vector3.zero;

        try
        {
            if (this._explosionSound != null)
            {
                AutoMonoBehaviour <SfxManager> .Instance.Play3dAudioClip(this._explosionSound, base.transform.position, 1f);
            }
            if (this._explosionSfx)
            {
                GameObject gameObject = UnityEngine.Object.Instantiate(this._explosionSfx) as GameObject;
                if (gameObject)
                {
                    gameObject.transform.position = base.transform.position;
                    SelfDestroy selfDestroy = gameObject.AddComponent <SelfDestroy>();
                    if (selfDestroy)
                    {
                        selfDestroy.SetDelay(2f);
                    }
                }
            }
            else
            {
                ParticleEffectController.ShowExplosionEffect(ParticleConfigurationType.LauncherDefault, SurfaceEffectType.None, base.transform.position, Vector3.up);
            }
            if (this.OnProjectileExploded != null)
            {
                this.OnProjectileExploded(this);
            }
            result = base.transform.position;
            this.Destroy();
        }
        catch (Exception exception)
        {
            Debug.LogException(exception);
        }
        return(result);
    }