I’m making a game object from scratch and adding a script that uses enums on it. I’d like to load a string from a file and convert that string into the enum and set the enum for the new object.
Edit:
Let me try to reexplain from scratch.
I’m trying to implement “user provided content” (custom textures) in an app that’s “in production”.
These textures are used on “tiles”. Each tile has a “Tile” script.
Tile.cs has TileUse and TileType enums. TileUse lets me know what the tile is being used for (as a floor, wall, corner etc). So, I load up this texture, place it on a game object, put Tile.cs on it and I need to change TileUse from floor (default) to what ever the user made it.
//Tile.cs
public enum TileUse {
floor,
wall,
corner,
openPassage,
passage,
endCap,
diagonalWall,
curvedWall,
goldFish
}
//SideParentSorter.cs
ctTransform.AddComponent<Tile>();
//Insert way to change TileUse (enum) on Tile.
//Insert way to change TileType (enum) on Tile.
Being completely self taught programmer I’m 90% sure this is a casting issue and 25% wtf at this point.