Skip to content

SirDragonClaw/XnaUnity

 
 

Repository files navigation

XnaUnitySpriteBatch

Provides a Xna SpriteBatch implementation for Unity use, allowing for quick and rough porting of Xna projects to Unity.

Related reading:

Most of the code is based on MonoGame, we reuse classes where possible and replace them when necessary. Some classes are cludged around for features that we do not support. The csproj expects that MonoGame is checked out adjacent to it, and references the MonoGame files via links.

To use this with unity: create a new solution file with your game code, reference this, build and then place the DLLs in the unity assets folder. See the unity documentation linked above for more details.

List of classes that we have replaced:

Audio/SoundEffect
Content/ContentManager
Graphics/Effect/Effect
Graphics/GraphicsDevice
Graphics/States/*
Graphics/SpriteBatch (this is based on a copy/paste of the MonoGame implementation)
Graphics/Texture2D
Media/Song
Game
GraphicsDeviceManager

To use:

  • Set up a unity GameObject
  • In the constructor create your game object and call UnityInitialise
  • Add a FixedUpdate function and call UnityFixedUpdate
  • Add a Update function and call UnityUpdate

About

Provides a Xna SpriteBatch implementation for Unity use, allowing for quick and rough porting of Xna projects to Unity.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 99.1%
  • ShaderLab 0.9%