Example #1
0
        public override void Draw()
        {
            //  Draw muzzle flash
            int       deltaTime = MySandboxGame.TotalGamePlayTimeInMilliseconds - m_rifleGun.LastTimeShoot;
            MyGunBase rifleBase = m_rifleGun.GunBase;

            if (deltaTime <= rifleBase.MuzzleFlashLifeSpan)
            {
                MyParticleEffects.GenerateMuzzleFlashLocal(this.Entity, rifleBase.GetMuzzleLocalPosition(), Vector3.Forward, 0.2f, 0.3f);
            }
        }
        public override void Draw()
        {
            //  Draw muzzle flash
            int       deltaTime = MySandboxGame.TotalGamePlayTimeInMilliseconds - m_rifleGun.LastTimeShoot;
            MyGunBase rifleBase = m_rifleGun.GunBase;

            if (deltaTime <= rifleBase.MuzzleFlashLifeSpan)
            {
                if (MySandboxGame.Config.GraphicsRenderer == MySandboxGame.DirectX9RendererKey)
                {
                    MyParticleEffects.GenerateMuzzleFlashLocal(Container.Entity, rifleBase.GetMuzzleLocalPosition(), Vector3.Forward, 0.1f, 0.3f);
                }
                else
                {
                    MyParticleEffects.GenerateMuzzleFlash(rifleBase.GetMuzzleWorldPosition(), rifleBase.GetMuzzleWorldMatrix().Forward, 0.1f, 0.3f);
                }
            }
        }