Ken
banner
burstcompile.bsky.social
Ken
@burstcompile.bsky.social
Lead developer & founder of Incandescent Games

Currently making PlanetSmith https://bsky.app/profile/planetsmith.bsky.social

Follow me for Unity tips and tricks
This is a great way to assign a list of objects to each value of an enum in the inspector. You can access using the enum at runtime. Be careful! Add new enum values at the end.

Class - pastebin.com/wDtSm2AZ
Drawer - pastebin.com/ayqjnCzW
Example - pastebin.com/aBiSLqvB

#unity #gamedev #coding
November 25, 2024 at 11:05 PM
Example Class
November 24, 2024 at 9:50 PM
This is a handy technique if you want access to a Sriptable Object anywhere in your game. Great for storing dictionaries of assets. I like to make a menu item in the editor to access the Resource Singleton which will also create an instance if none exist in the project. #unity #gamedev #code
November 24, 2024 at 9:47 PM
Making this post made me think about it more which is a good thing and there are a few improvemts to make. I should use a Stack not a Queue as order doesnt matter and stack is slightly faster. Also the set on the Auto Properties should be private. heres an updated version.
November 21, 2024 at 11:54 PM
I like to use this method when I need to pool objects. Keeps the code clean as you can now call DroppedObject.Pool.Get() to get a instance from the pool or create a new instance if there are none in the pool. You can also link a prefab if you need to Instantiate. #unity #code #gamedev
November 21, 2024 at 8:34 PM