Scriptable Cookbook: Damage Type System With ScriptableObject Enums (Unity Tutorial)

preview_player
Показать описание
In this Unity3d tutorial we learn how to create and use ScriptableObjects to replace C# enums or enumerations in a flexible and extensible approach. We'll use this to setup a simple elemental damage system with different damage types like fire, ice, and poison. The idea is that we can check equality against the ScriptableObject asset, instead of checking against an Enum entry. We can also add data or code to these objects as needed. This is an adaptation of an approach shown by Richard Fine and Ryan Hipple in their respective Unite talks which can be found in the Scriptable Cookbook playlist here:

Рекомендации по теме
Комментарии
Автор

This is the video that actually got me to use Scriptable Objects. Spent alot of time watching other vids to wrap my head around them, but this one illustrated a perfect use case for me to take the plunge.

Inkleth
Автор

Thank god I found this series. Thank you for making this. Not enough people have teaching material using scriptable objects, unity events, and game dev using the unity editor and stuff.

Skyefaux
Автор

Thanks for the excellent video. I found it really helped me cement the relatively short Extendable Enums section Richard Fine covers in his Unite talk and better understanding how, by implementing empty SOs in this way, it provides flexibility, null support and potential future extension within the SOs themselves. Thanks again. I'm now off to checkout the rest of the series!

ZapBran
Автор

Your code is so clean and easy to understand, really appreciate your tutorials

CharkGames
Автор

I just found your Scriptable Cookbook series and I had never considered the sheer flexibility of the Scriptable Objects so I must thank you.
Im glad I found this out early in my games development because its going to make things so much easier now i believe.

sekunriruisen
Автор

Wonderful video, Matt! Very helpful! I've been on a ScriptableObject binge as of late!

xkittencatx
Автор

Thank you! This explained exactly what I needed. Sad to see this channel on pause, good luck on your game!

Deciphersoul
Автор

I love scriptable objects. It took me a while and quite a few watchthroughs of Richard Fine's monbehaviour tyranny speech to get them, but once I did...

Nemega
Автор

This is a great example of implementation of SOLID's open/close principal. The next step on that journey would be full C# classes but you'd only need that if each damage type had custom code, rather than just properties.

Great work!

RobLang
Автор

LOL! Yesterday I was coding my very own enum replacement with ScOb, for damageTypes. Thanks again for your video.

gasparweb
Автор

really well explained and nice to see it in effect during gameplay too. Thanks for the vid, much appreciated!

Tastygraph
Автор

Perfect Matt! Exactly what i was looking for, thanks :)

BlueGooGames
Автор

Great info here thanks. been studying scriptable objects for awhile now very useful stuff.

clearnandimprove
Автор

Good video Matt! Appreciate your work!

erz
Автор

The exact same thing can be done with abstract classes, or interfaces. I am starting to understand that a ScriptableObject is basically a beefed up version of an abstract class, with the added quality of life feature of being serializable by nature, and work in a way such as you don't have to define the "concrete implementations" of a scriptable object, leading to a lot less code.

Basically anywhere I'd use an abstract class or interface, I will think if a scriptable object can do the job. The problem you presented on this video I'd normally solve using an abstract class or interface for example. Enums are not really a good idea here, even if ScriptableObjects didn't exist.

marcusmarcus
Автор

Hi Matt, I love your content and I really appreciate your procedural generation series. I love to hear some beginner Voronoi tutorial or resource from you if it's not too much to ask. Thanks and keep up your great content!

cemugurkaracam
Автор

Great video as always Matt :) This series is really useful and offers a lot of good ideas for well-think design!

TNTCProject
Автор

Thanks for going so deep in the technical details. Quite rare to find a good software architecture video in all the noise around. I've shared it in reddit.com/r/VisualSchool. Cheers, Matt!

visualschool
Автор

Super awesome video, thank you. This has been a big pain in my noodle to unravel. This video helped immensly. I do miss Tim and Erik though. hehehe.

vickdeweo
Автор

Lol, if only you had posted this 2 weeks ago, would have saved me some design time. Though I'm using a similar system to this to let the player make spells at runtime

Lilith_TheDireGay
join shbcf.ru