Resetting Scriptable Objects - Unity Playmode
One Wheel Studio
🕹️Steam Wishlist: https://store.steampowered.com/app/2510180/Deep_Space_Directive/ ✅🎮👉 Current Build on Itch: https://onewheelstudio.itch.io/hex-game
Scriptable objects are a useful tool in the Unity game engine to hold static data. However, if you need to change data or values in a scriptable object at runtime things get a bit tricky. With lifecycle functions like OnEnable and OnDisable or using the NonSerialized attribute we can solve those problems.
Support the Channel!
► Buy me a coffee: https://www.buymeacoffee.com/onewheelstudio ► Shop the Unity Asset Store (affiliate): https://assetstore.unity.com/top-assets/top-paid?aid=1100lHSw ► Become A Channel Member: https://www.youtube.com/channel/UCkr9CPPqT9VWUjkpo3HcACg/join ► Or a Patron: https://www.patreon.com/onewheelstudio ► My video and streaming kit: https://kit.co/onewheelstudio/tutorial-video-production ► Buy a Game Design Book: https://kit.co/onewheelstudio/game-design-reading-list-unity-c-blender-and-more
Video Gear List (Amazon Affiliate)
► Sony A6100 Camera: https://amzn.to/32logXz ► Sigma 16mm 1.4 Camera Lens: https://amzn.to/3KA4Wr4 ► GoXLR (audio interface): https://amzn.to/35dmr03 ► Shure SM7B Mic: https://amzn.to/3fNbV1E ► Blue Mic Arm: https://amzn.to/3tHgwdQ Neewer Light: https://amzn.to/3rD8eRv Light Softbox: https://amzn.to/3GUaHgQ Neewer RGB Light: https://amzn.to/3rCTQJ9
Other Links
Discord: http://discord.onewheelstudio.com
Twitter: https://twitter.com/OneWheelStudio
Devlog: https://onewheelstudio.com/
Twitch: https://go.twitch.tv/onewheelstudio
Timestamps
0:00 SOs are awesome, but... 0:34 Deep Space Directive 1:00 Change SOs at Runtime 2:39 Solution #1 - OnEnable & OnDisable 4:32 Solution #2 - NonSerialized Attribute (!!!) 5:36 THE END... #GameDevelopment #Unity3D #indiedeveloper ... https://www.youtube.com/watch?v=x8rQcJ6yfE4
69027567 Bytes