예제 #1
0
    bool InternalSpawnExplosionWaveFX(Vector3 worldPos, MFExplosionPostFX.S_WaveParams waveParams)
    {
#if UNITY_EDITOR
        return(true);
#else
        if (!Camera.main)
        {
            return(false);
        }

        Vector3 posInView = Camera.main.worldToCameraMatrix.MultiplyPoint(worldPos);

        if (posInView.z > 0)
        {
            if (waveParams.m_Radius < 0.75f)
            {
                return(false);
            }

            posInView.z = -posInView.z;
        }

        Vector3 worldPosFixed = Camera.main.cameraToWorldMatrix.MultiplyPoint(posInView);
        Vector3 pos           = Camera.main.WorldToViewportPoint(worldPosFixed);
        Vector2 spos;

        CreateCamFXInstance();

        spos.x = pos.x;
        spos.y = pos.y;

        MFExplosionPostFX.Instance.EmitGrenadeExplosionWave(spos, waveParams);

        return(true);
#endif
    }
예제 #2
0
    public void SpawnExplosionWaveFX(Vector3 worldPos, MFExplosionPostFX.S_WaveParams waveParams, float inDelay)
    {
        waveParams.m_Delay = inDelay;

        InternalSpawnExplosionWaveFX(worldPos, waveParams);
    }