chore: Compiler Warnings Fixed
This commit is contained in:
parent
5512696a04
commit
8ec918ca04
|
@ -34,9 +34,11 @@ public class MovementBoxBehaviour(Keys Up, Keys Down, float High, float Low, flo
|
|||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
if (!BehaviourController.TryGetBehaviour(out inputs))
|
||||
if (!BehaviourController.TryGetBehaviour<IKeyboardInputs>(out var behaviourResult))
|
||||
throw new Exception($"{nameof(IKeyboardInputs)} is missing on ${GameObject.Name}.");
|
||||
|
||||
inputs = behaviourResult;
|
||||
|
||||
inputs.RegisterOnPress(Up, OnUpPressed);
|
||||
inputs.RegisterOnRelease(Up, OnUpReleased);
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@ namespace Pong;
|
|||
|
||||
public class Game1 : Game
|
||||
{
|
||||
private GraphicsDeviceManager _graphics;
|
||||
private SpriteBatch _spriteBatch;
|
||||
private GraphicsDeviceManager _graphics = null!;
|
||||
private SpriteBatch _spriteBatch = null!;
|
||||
private GameManager gameManager = null!;
|
||||
|
||||
public Game1()
|
||||
|
@ -23,6 +23,8 @@ public class Game1 : Game
|
|||
PreferredBackBufferWidth = 1024,
|
||||
PreferredBackBufferHeight = 576
|
||||
};
|
||||
_spriteBatch = new SpriteBatch(GraphicsDevice);
|
||||
|
||||
Content.RootDirectory = "Content";
|
||||
IsMouseVisible = true;
|
||||
}
|
||||
|
@ -39,8 +41,6 @@ public class Game1 : Game
|
|||
|
||||
protected override void LoadContent()
|
||||
{
|
||||
_spriteBatch = new SpriteBatch(GraphicsDevice);
|
||||
|
||||
Sprite spriteBox = new Sprite() { Texture2D = Content.Load<Texture2D>("Sprites/Pixel") };
|
||||
Sprite spriteBall = new Sprite() { Texture2D = Content.Load<Texture2D>("Sprites/Circle") };
|
||||
|
||||
|
|
Loading…
Reference in New Issue