I am working on a ship builder for my 2D space game, where players can customize every aspect of their ships. However, players will need to provide their own ship sprites. What is the best way to achieve this?
I have already explored two possibilities:
-
Using Addressables: Players would need to download the Unity editor, create an asset bundle of sprites, and then import it into the game. However, downloading the entire Unity editor and handling the import/export process might be too complex for most players.
-
Loading Images Directly: I found a method for loading images directly into the game from here, though I haven’t tested it yet. Will this approach impact performance or compatibility?
public static Texture2D LoadPNG(string filePath) {
Texture2D tex = null;
byte[] fileData;
if (File.Exists(filePath)) {
fileData = File.ReadAllBytes(filePath);
tex = new Texture2D(2, 2);
tex.LoadImage(fileData); //..this will auto-resize the texture dimensions.
}
return tex;
}
I appreciate any insights or recommendations you can provide.