Since both the beetle's sheild and the beetle-shell equipped sprite over the player both dynamically update according to the value of an integer (the beetle's health and the damageAbsorption count on the Player respectively), I am TRYING to create a script that would read an arbitrary integer field's value and set the sprite of a sprite renderer component on the same game object to a sprite mapped to that integer value in a list of pre-defined pairings that I can modify from the inspector (basically a dictionary except as an array of structs with an integer and Sprite field because C# dictionaries, I discovered, cannot be seen from the inspector window, just the cherry on top of the mountain of things about this endeavor that are royally pissing me off)
Sounds fairly simple, right?
WRONG!
It turns out, this is, to an asinine, absurd, downright hilarious degree, WAY more convoluted to do this conceptually simple action than any reasonable human being would ever idly think about even fever-dreaming to be the case! The obstacle I'm running into is getting the "arbitrary integer field" part of this to actually work. YES, you CAN use system.reflection BUT then performance may take a hit because I need to regularly check the value in order to do this and I won't allow THAT to happen because of course I'm too damn stubborn for my own good and need my game to run well in order to be satisfied with my work as the developer. Stupid fricking...

1 comment