From 3e78162361e52339d3be0b2a1282c749156e1004 Mon Sep 17 00:00:00 2001 From: Memorix101 Date: Thu, 20 Apr 2023 01:05:02 +0200 Subject: [PATCH] small improvements --- .../XNAEmulator/Game/GraphicsDeviceManager.cs | 2 +- .../Scripts/XNAEmulator/Graphics/GraphicsDevice.cs | 3 ++- Assets/Scripts/XNAEmulator/Media/MediaPlayer.cs | 13 +++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/XNAEmulator/Game/GraphicsDeviceManager.cs b/Assets/Scripts/XNAEmulator/Game/GraphicsDeviceManager.cs index 5710ebe..1f192f7 100644 --- a/Assets/Scripts/XNAEmulator/Game/GraphicsDeviceManager.cs +++ b/Assets/Scripts/XNAEmulator/Game/GraphicsDeviceManager.cs @@ -6,7 +6,7 @@ using Microsoft.Xna.Framework.Graphics; namespace Microsoft.Xna.Framework { - class GraphicsDeviceManager + public class GraphicsDeviceManager { private Game game; diff --git a/Assets/Scripts/XNAEmulator/Graphics/GraphicsDevice.cs b/Assets/Scripts/XNAEmulator/Graphics/GraphicsDevice.cs index 828ecbe..48045eb 100644 --- a/Assets/Scripts/XNAEmulator/Graphics/GraphicsDevice.cs +++ b/Assets/Scripts/XNAEmulator/Graphics/GraphicsDevice.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using UnityEngine; namespace Microsoft.Xna.Framework.Graphics { @@ -33,7 +34,7 @@ namespace Microsoft.Xna.Framework.Graphics internal void Clear(Color color) { - + Camera.main.backgroundColor = new UnityEngine.Color(color.R, color.G, color.B); } } } diff --git a/Assets/Scripts/XNAEmulator/Media/MediaPlayer.cs b/Assets/Scripts/XNAEmulator/Media/MediaPlayer.cs index 117a6f5..ccadeda 100644 --- a/Assets/Scripts/XNAEmulator/Media/MediaPlayer.cs +++ b/Assets/Scripts/XNAEmulator/Media/MediaPlayer.cs @@ -27,9 +27,22 @@ namespace Microsoft.Xna.Framework.Media } } + public static float Volume + { + get + { + return audioSource.volume; + } + set + { + audioSource.volume = value; + } + } + internal static void Play(Song song) { audioSource.clip = song.Clip; + audioSource.volume = Volume; audioSource.Play(); } }