Unite 2016 - Overthrowing the MonoBehaviour Tyranny in a Glorious Scriptable Object Revolution

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ย. 2024

ความคิดเห็น • 140

  • @unityberserkers8351
    @unityberserkers8351 7 ปีที่แล้ว +396

    [1:00] In this talk
    [1:34] The MonoBehaviour Tyrrany
    [5:58] Uninstantiated prefabs help a bit, but...
    [8:31] C# statics are very DIY
    [9:34] ScriptableObject
    [10:51] How ScriptableObject saves us pain
    [12:55] How to declare + reference ScriptableObject
    [13:55] How to create ScriptableObject
    [15:49] ScriptableObjects Callbacks
    [17:18] ScriptableObject Lifecycle
    [18:05] A note on Destroy() / DestroyImmediate()
    [20:55] Patterns
    [21:29] Data Objects and Tables
    [23:39] Extendable Enums
    [25:44] Dual Serialisation
    [26:37] Dual Serialisation example
    [28:31] Reload-Proof Singletons
    [30:14] Reload-Proof Singletons example
    [31:44] Delegate objects
    [32:53] Delegate objects example
    [35:44] Practice
    [35:49] TANKS! Demo

    • @zjjackson101
      @zjjackson101 6 ปีที่แล้ว

      How did you create the "table of contents" links? I can see from hovering over the links that each URL link consist of "URL" = Xseconds so this can be made by calculating the time in seconds and then adding that additional seconds identifier at the end, is there an easier way to generate this?

    • @EqualToBen
      @EqualToBen 6 ปีที่แล้ว +4

      zjjackson101 any time you say two numbers separated by a semi colon 13:37 it creates a link to the video your comment is on

    • @grahamnelson203
      @grahamnelson203 5 ปีที่แล้ว +20

      People who time code TH-cam videos are saints.

    • @magnusm4
      @magnusm4 3 ปีที่แล้ว +1

      @@grahamnelson203 People who make soundtrack videos and don't set times for the songs are monsters.

  • @notsospy
    @notsospy 3 ปีที่แล้ว +21

    Absolute mandatory talk for anyone even remotely interested in using Unity for more than day or two. Sad that it only has a handful of likes, and even sadder still that in 2021 almost all the tutorials you find on TH-cam, Udemy, etc. don't come close to teaching these patterns!

    • @captainnoyaux
      @captainnoyaux 2 ปีที่แล้ว

      Do you have good recent talks about Scriptable Object usage and patterns ? I'm really interested in that feature

    • @Koooles
      @Koooles ปีที่แล้ว

      There is Text Adventure tutorial on both Unity TH-cam and Unity Learn that uses a lot of scriptable objects, which is where it told to check this talk out.

  • @NoComment_Plays
    @NoComment_Plays 6 ปีที่แล้ว +12

    So much good stuff in here, I highly recommend downloading his repo to check out his code first hand. That audio preview is extremely clean. Thank you Richard

  • @nipponese
    @nipponese 7 ปีที่แล้ว +193

    I think the reason most people don't know about it is because none of the tutorials or live training sessions ever mention it. Every Unity Learn video I've seen relies on the singleton design pattern using static variables in a game controller script.

    • @unity
      @unity  7 ปีที่แล้ว +71

      Check out my two live sessions: Text Adventure Part 1 and Pluggable AI. Both use the delegate pattern described here with ScriptableObjects. - Matt

    • @noahtsutsui6331
      @noahtsutsui6331 7 ปีที่แล้ว

      nipponese ah, great to know

    • @oakherder17
      @oakherder17 6 ปีที่แล้ว +1

      Me too!

    • @OoElectron
      @OoElectron 6 ปีที่แล้ว +17

      If there was an item named "Scriptable object" in create menu, most users would've known about it.

  • @drawnsequence
    @drawnsequence 2 ปีที่แล้ว +2

    This man is peak performance. Clear presentation, zero filler everything needed for understanding even to a newbie like me that only gets the most basic concepts of OOP.

  • @noejacques
    @noejacques 2 ปีที่แล้ว

    Amazing !
    I'm a Game Design student, finishing my 2nd year. Next year we will be focusing on producing a game along with the artists of the school, and this talk has been very inspiring on how we can manage implementation on a wider production than the prototypes we've done so far !

  • @soogoonu
    @soogoonu 7 ปีที่แล้ว +1

    I was just struggling with a problem without clues on how to cope with in a decent way, and voila' the answer: Scriptable Objects! thank you for this precious class

  • @Mohammad-kx2rk
    @Mohammad-kx2rk 6 ปีที่แล้ว +2

    really useful (after 9 years dev without SOs) .awesome presenter too

  • @jkommun
    @jkommun 6 ปีที่แล้ว +31

    Goblins dont drop Amulet Of Yendor. This is bogus!

  • @Drastonar
    @Drastonar 3 ปีที่แล้ว +2

    Great talk! I wanted to use the AudioEvent on my project, but the bitbucket link is broken... guess I'll implement something similar.

  • @Ticklersoft
    @Ticklersoft 7 ปีที่แล้ว +2

    Thanks for this talk and sharing!

  • @harrysanders818
    @harrysanders818 5 ปีที่แล้ว

    This is extremely mindblowing. I Love you !

  • @pt8306
    @pt8306 4 ปีที่แล้ว +2

    Are these assets still available somewhere? Bitbucket no longer hosts them

  • @RamenManGod
    @RamenManGod 6 ปีที่แล้ว +1

    Great talk and great T-shirt!!!!

    • @taylorbird901
      @taylorbird901 ปีที่แล้ว

      where can one find this t-shirt?

  • @teamchemistryrex
    @teamchemistryrex 6 ปีที่แล้ว +7

    For the pluggable Tank brain, I see that you are using GetComponent in Update. I assume its to avoid the issue where you shouldn't set any data in ScriptableObject because it serves as a template for all the objects created from it. Isn't this a bad solution? To call GetComponent in every frame?

    • @sergeyyjyakunin1514
      @sergeyyjyakunin1514 5 ปีที่แล้ว +1

      it's diffenitly bad solution. Never do that. All components must be precashed

  • @martinfinch5011
    @martinfinch5011 8 หลายเดือนก่อน

    How many of you actually plan out your game architecture from the beginning. I dont recall ever being on a project that did this.

  • @ChristianKroken
    @ChristianKroken 7 ปีที่แล้ว

    Good talk, and excellent examples.

  • @JustinReinhart
    @JustinReinhart 5 ปีที่แล้ว +3

    Hahaha. That guy sliding across the screen at 39:45.

  • @hugoleofer
    @hugoleofer 7 ปีที่แล้ว

    This was great. Thank you!

  • @Koooles
    @Koooles ปีที่แล้ว

    Can you essentially then have all helper functions on ScriptableObject?

  • @gunting
    @gunting 3 ปีที่แล้ว +1

    Anyone got the backup for the link? The bitbucket page seems to have gone 404

  • @raeion6352
    @raeion6352 7 ปีที่แล้ว +4

    Where is the bitbucket link ? I want to see the source code for the tanks example

  • @phaserlocust8244
    @phaserlocust8244 4 ปีที่แล้ว +1

    Unfortunately the link to assets is no longer working.

  • @royorgames771
    @royorgames771 3 ปีที่แล้ว +2

    Hi, does anyone have a working link to the repository or a similar one (especially the AudioEvent and the slides on the volume and pitch)?

    • @sulfurasmr6365
      @sulfurasmr6365 3 ปีที่แล้ว +1

      It's the github link labelled "Get the Assets Here" in the description

    • @royorgames771
      @royorgames771 3 ปีที่แล้ว +1

      @@sulfurasmr6365 Thank you, for several things. Completely forgot this talk and rewatched it, good gems. And why didn't I see the link last time? who knows =)

  • @rogerbusquetsduran5596
    @rogerbusquetsduran5596 3 ปีที่แล้ว

    So much effort put into making things available to C# when it would've been so much easier not to use C# at all and make everything work in C++. If they wanted to use C# just write the engine in C# from the very beginning...

    • @oldcat1790
      @oldcat1790 3 ปีที่แล้ว +1

      I mean, С++ is one of the main reasons why many developers still don't use UE, even despite its recent achievements.

  • @travlake
    @travlake 3 ปีที่แล้ว

    Any thoughts on why AudioEvent is an Abstract class instead of an interface? Interface would be more flexible if future implementations wanted to have AudioEvents coded as raw C# classes or MonoBehaviors, and would also allo the same scriptableobject to implement both IAudioEvent and IParticleEvent or whatever, which can be nice for design if the same event is inherently both

    • @denisgoodman4492
      @denisgoodman4492 3 ปีที่แล้ว +4

      In general, the Abstract class = Interface, but have some advanced in Unity university (at current moment "till version 2021") - *it can be simply serialized* (if it derived from Monobehaviour or from ScirptableObject is doing automatically). Therefore, it can be very simple showing in Inspector (you can write amazing & useful Custom Editor & Properties Drawer). And also the variable (field) which storing this reference automatically saved (updated) in Inspector. If you try did the same for the interface, it's more hard and have some limitation (can find some examples on unity forums).
      Interface have some advances vs Abstract Class (in c#) in very hard object oriented structures, but it is not demands very often in gamedev in Unity. And you can create a collection of separate abstract classes for each variant of a different combination of different interfaces (AbsC1 : ScirptableObject , Inteface1, Inteface3 ; AbsC2 : ScirptableObject , Inteface2, Inteface3 and so on).
      If in future of UNITY (may be) the interface became serializable, may be in this case the it use in this case became more appropriate.
      But what did, in this Example, *Richard Fine & Co (Custom Editor & Properties Drawer) it is AMAZING work for real production environment* (when you have a big team - separated Game Devs & Game Designers). If you work on very simple project (and you didn't separated the Game Devs & Game Designers) you can more prefer doesn't spear time on useful interface for "Game Designers" and doing more in C# plain code, but it will hard to support & modernization in future (the same as with documentation the code)

    • @travlake
      @travlake 3 ปีที่แล้ว

      @@denisgoodman4492 Thanks, that all makes sense. I forgot about the serialization issue because I use Odin, which serializes interface refs no problem.
      Another advantage of interfaces is you can inherit from multiple interfaces but not multiple abstract classes. One example for why this is useful is because it allows one SO to contain all enemy data, including its sprite, sfx, etc, for example, in a single asset. The audio manager can then reference it also with other ISFXProviders, a UI element can receive any ISpriteProvider whether it's an EnemyData or BuildingData, etc.

    • @denisgoodman4492
      @denisgoodman4492 3 ปีที่แล้ว +1

      @@travlake I am not using Odin, but this asset completely rebuilds the inspector, in which case it can be useful if you need to serialize the interface.
      As I said, you can create a complex abstract class and put all the required interfaces in it. Maybe not as elegant as with interfaces + Odin , but you can save some money :) ... Ultimately, the choice of a particular method is a matter of taste :) ... Thank you for information regarding Odin, i put it in my notes.

  • @zrratul
    @zrratul 6 ปีที่แล้ว

    great video

  • @lukajaksic9115
    @lukajaksic9115 3 ปีที่แล้ว

    The dude dying coughing midway through the presentation is killing me lol

  • @joanofarc2276
    @joanofarc2276 7 ปีที่แล้ว

    why scriptableObject not save when changes scenes? please

  • @RendallRen
    @RendallRen 2 ปีที่แล้ว

    "And also something I didn't put on the slide, that is really important, we want to set the on it."
    What? What the heck did he say at 31:05? The "height flag"? What is that and how do you do it?

    • @MoogieSRO
      @MoogieSRO 2 ปีที่แล้ว +3

      Hi, he said the "hide" flag, to stop the garbage collector clearing it up. Hope that helps you :)

  • @tolu619
    @tolu619 7 ปีที่แล้ว

    So does this talk have exactly the same content as the talk of the same name from Unite Europe in July 2016, or do I have to watch both 1 hour talks?

    • @richardfine5502
      @richardfine5502 7 ปีที่แล้ว +10

      It's *mostly* the same, but I streamlined some parts, and added a little more detail in others based on feedback from the Europe talk. If you've already seen the Europe talk and grokked it, you probably won't get a ton of new stuff from this one.

    • @tolu619
      @tolu619 7 ปีที่แล้ว +1

      Richard Fine I ended up watching this first, then struggling to watch the Europe talk afterwards, since I had already seen this. Thanks for opening our eyes to Scriptable objects. Now all I have to do is come up with my own MVVM implementation using these ;)

  • @patek2385
    @patek2385 2 ปีที่แล้ว

    His look says "typical discord mod", but his KNOWLEDGE says "gigachad".

  • @nonlmao
    @nonlmao 2 ปีที่แล้ว

    14:50 21:20 28:30

  • @RubenGoMoRadioboyPlus
    @RubenGoMoRadioboyPlus 3 ปีที่แล้ว +2

    Richard is hot

  • @someoneontheinternet3090
    @someoneontheinternet3090 3 ปีที่แล้ว

    What exactly does Serialized mean?

    • @denisgoodman4492
      @denisgoodman4492 3 ปีที่แล้ว

      in very general terms - it can be simply and quickly store on disk (in Unity the serializable objects, use to tune game, automatically stored its state).
      You can write simple game did write not any line of code, simply drag&drop different objects and tune its parameters (all these parameters it's a serializable objects).

    • @IDontReadReplies42069
      @IDontReadReplies42069 ปีที่แล้ว

      All of your variables, jump height, attack speed and so on all have a spot in your computer's memory when you press "run". So, in your "PlayerScript" you could set jumpHeight to 1, but what if you want the jump height to increase when you get a power up? And even more importantly, what if you want to exit out the game , come back and STILL have that jump height have the boost? Well, every time you press "Run" your jump height is going to be what ever you set it as in your code! Unless we find a way to give the illusion of "remembering" our jumpHeight. Luckily your computer has a hard drive or a solid state drive! So what we can do, is we can "save" that jump height value to some sort of file in a folder somewhere on our hard drive and then whenever we want to know what the jump height is in game, we'll just check that file (and conversely, save to it as well). Serialization lets us do exactly that, remember when I said that your jumpHeight has a spot in your computers memory? Well every single time you press "Run" your computer might be giving it a different address....and addresses are how our programs know which variable is which so we can't just give the file all the memory addresses, and not only that but there's not just one type of int, there's bigger ints and smaller ints types! So there has to be some sort of standard that everyone adopts, and that standard is called Serialization, serialization lets us take our jumpHeight, and turn it into bytes (the building blocks of computer data) and store it away in some file that we can take from whenever we want that data.

  • @zcristiam
    @zcristiam 4 ปีที่แล้ว

    38:10

  • @jiraiya9749
    @jiraiya9749 6 ปีที่แล้ว +3

    Soy novato en unity en verdad mi sueño es crear un videojuego y lo voy a lograr, estoy contento con su motor unity, el único pero que le veo es que aunque todo esté aprendizaje me ayuda mucho a aprender inglés y eso es bueno en verdad, pero si me gustaría q hubiera un apoyo en cuanto al idioma soy d México y la verdad aunque tengo muchas ganas d aprender es muy complicado para mi por el idioma ojalá algún día lo pudieran traducir por favor y muchas gracias

    • @LucyPero
      @LucyPero 6 ปีที่แล้ว

      Hola. Qué querés saber? Tal vez te pueda ayudar en algo. Pero es muy importante que aprendas Inglés si vas a programar/hacer juegos

    • @jiraiya9749
      @jiraiya9749 6 ปีที่แล้ว

      Matías Pierdoménico claro q si bro es muy importante, el pero es q soy medio wey para el inglés 😭 , y sigo todavía con mi proyecto será en 3d si gustas t paso mi Facebook José Raúl Cordazar broadius y muchas gracias bro por brindarme d tu tiempo

    • @alejmc
      @alejmc 6 ปีที่แล้ว +1

      Buenisima tu iniciativa : ).
      Aparte de los tutoriales de Unity en su página, recomiendo a lo mejor también utilizar algo que básicamente funciona "out of the box". Hay un Engine en el asset store para hacer "infinite runners" y juego de plataformas muy fácilmente. "Corgi Engine" se llama. Hay también add-ons para él.

    • @jiraiya9749
      @jiraiya9749 6 ปีที่แล้ว

      Alejandro Martinez-Chacín gracias ya ando en eso, de echo me encuentro modelando los objetos que quiero en blender y de hay los paso a unity, llevo muy poco pero lo terminaré jeje

  • @Kombi-1
    @Kombi-1 6 ปีที่แล้ว

    haha

  • @williamheckman4597
    @williamheckman4597 11 หลายเดือนก่อน

    Maybe C# just sucks?

  • @mireazma
    @mireazma 6 ปีที่แล้ว

    I got the feeling that scriptable objects are still in development and not quite working flawlessly and I've seen users abandon them for monobehaviours, for this reason.

  • @janoschii
    @janoschii 7 ปีที่แล้ว

    This video should actually start at 13:00. The first 13 minutes where really painful. The intro was more a conclusion.

  • @cave6665
    @cave6665 9 หลายเดือนก่อน

    I asked chat gpt for an obscure website and it linked this.

  • @coolorphans
    @coolorphans ปีที่แล้ว

    1025

  • @DerrickTheFork
    @DerrickTheFork 7 ปีที่แล้ว +440

    I'm starting to think that planning code architecture with scriptableObjects in Unity is actually more fun than playing actual games

    • @unity
      @unity  7 ปีที่แล้ว +104

      same tbh - Matt

    • @magnusm4
      @magnusm4 5 ปีที่แล้ว +15

      I know. I've tried getting into gaming since i'm spoiled by old masterpieces like Rayman 2 and 3 and Resident Evil 4 and Psychonauts. Creative, long, intriguing, FUN and really immersive with it's themes and solid gameplay.
      But when I play Risk Of Rain 2 or LoL I keep ending up saying.
      SCREW THIS i'm gonna go -play Minecraft- work on making real games instead. And then I end up sitting in a Krita animation/drawing, Blender modeling/rigging/drawing texture or programming and learning new things about Unity.
      Or I look up WW1 and 2 guns and stuff and just think: "WHY ISN'T ANY OF THIS IN COD OR BATTLEFIELD?!"

    • @Roxioxx
      @Roxioxx 3 ปีที่แล้ว

      Same

    • @SubjektDelta
      @SubjektDelta 3 ปีที่แล้ว +1

      @@magnusm4 because world war is boring. All world war games died in months.

    • @stevenrogersfineart4224
      @stevenrogersfineart4224 2 ปีที่แล้ว +1

      100% agree. I enjoy being a creator not a consumer 😀

  • @tonyrigatoni766
    @tonyrigatoni766 6 ปีที่แล้ว +148

    This guy is a really good speaker, and the information is priceless for game developers. Thanks for sharing this wonderful talk!

    • @Flem100DK
      @Flem100DK 2 ปีที่แล้ว

      Yes. He is very good!

  • @ccerrato147
    @ccerrato147 4 ปีที่แล้ว +9

    Watching in 2020, still a good intro.

  • @rad-man
    @rad-man 7 ปีที่แล้ว +13

    This talk is awesome!! Thank you! As a new Unity developer this has resolved most of my heaviest concerns I've had since trying to learn game development. Im so excited to get home and fix my code :)

  • @lunardust201
    @lunardust201 7 ปีที่แล้ว +21

    Great talk, very good presenter too

  • @MElsy666
    @MElsy666 6 ปีที่แล้ว +20

    this video just changed everything about the way i build games. Everything. Thank you so much I dont stray from mono very often but i will now for sure

  • @BJBaye
    @BJBaye 7 ปีที่แล้ว +9

    Fantastic talk, this sounds incredibly useful. I'm not sure I can wrap my head around how to actually use them yet, but I can look up the documentation for that hopefully. (I'm really less than 2 weeks in to actually using Unity. A lot to learn still.)

  • @vincentdaxbek1270
    @vincentdaxbek1270 4 ปีที่แล้ว +7

    Mister Fine, your talk is still as of today the most influential and useful 'learning' element I could run into among all the tutorials/Unity Learn videos/stack overflow posts/e-book I ever saw/read.
    For this, I send you my Regards !

  • @TheSacrificialLambda
    @TheSacrificialLambda 7 ปีที่แล้ว +14

    Fantastic presentation and game changer .. for making games.

  • @hommfan2
    @hommfan2 4 ปีที่แล้ว +3

    I just stumbled across this gem of a talk. However, the assets link no longer works! :( Can anyone put up a copy? I'm trying to follow along with his examples and right off the bat, I'm getting MinMaxrange and RangedFloat could not be found!

  • @anzo06
    @anzo06 7 ปีที่แล้ว +18

    problem with unity is there is so much feature that we forgot to use them. i remember having used this 4 years ago then forgot it

  • @pitabreadboi8248
    @pitabreadboi8248 4 ปีที่แล้ว +2

    Repo link doesn't work anymore. Did it move? Or was made private?

  • @synthercat
    @synthercat 3 ปีที่แล้ว +3

    It's doesn't seem to be online on bitbucket anymore.

  • @47Mortuus
    @47Mortuus 4 ปีที่แล้ว +7

    Poor man's ECS.

  • @ClutchGen
    @ClutchGen 3 ปีที่แล้ว +3

    48:40 Ok, this is where the ScriptableObject potential is starting to click for me. Thanks Richard and team!!

  • @TESkyrimizer
    @TESkyrimizer ปีที่แล้ว +1

    Am I wrong to think that Singletons are still necessary but it's just that you shouldnt be using them like hotcakes?
    For some scene dependent managers you'll need to have a singleton yes? Much better than dragging your AudioManager gameobject (with its child audioSources) into so many SerializedFields for other systems to reference, I think. 🤔

  • @-.._.-_...-_.._-..__..._.-.-.-
    @-.._.-_...-_.._-..__..._.-.-.- 2 ปีที่แล้ว +1

    These people get really excited when he exits play mode.

  • @benjaminhawkins1129
    @benjaminhawkins1129 2 หลายเดือนก่อน

    this is an amazing talk. my mysophonia was on fire with the lip smacking at the end of every sentence, but... its so informationally relevant 7 years later i watched the whole thing!

  • @elbow838
    @elbow838 ปีที่แล้ว +1

    I've watched this like 20 times. I thought it made sense, I just wasn't fully ready to hear it until today

  • @rapidsl0th45
    @rapidsl0th45 2 ปีที่แล้ว +6

    I'm a little late to this party but .. I'm in my third year studying game development and scriptable objects haven't been mentioned at all. I'm looking forward to learning more about them and using them. Custom editors as well, they look fun.

  • @sokpisethlalalanno
    @sokpisethlalalanno 3 ปีที่แล้ว +1

    I'm not playing game here but Unity is truly the best.

  • @rodolink_2
    @rodolink_2 4 ปีที่แล้ว +1

    changing the Health value inside the llHealthBuff breaks the Open/close principle no?

  • @JuanCarlosGCJuanktigreXXV
    @JuanCarlosGCJuanktigreXXV 4 ปีที่แล้ว +1

    Any one has the assets? it would be nice if someone posts the link

  • @RenegadeVile
    @RenegadeVile ปีที่แล้ว +1

    As an experienced software engineer coming back to Unity after 10 years, when I saw ScriptableObject referenced in one of the eBooks, I was instantly interested. Simplicity is indeed king and from an architectural standpoint, using these for A LOT of different purposes is so much cleaner than jamming singletons or MonoBehaviors everywhere.

    • @unitydev457
      @unitydev457 ปีที่แล้ว

      Yeah, this solves so many problems that I ran into when I was learning unity and game programming a decade ago. Especially back when using unity in version 4 or 5.x before the multi scene paradigm. you'd have to have an init scene with your singletons that call dontdestroyonload and persist through your project, so in order to test anything you had to start from that init scene

    • @RenegadeVile
      @RenegadeVile ปีที่แล้ว

      @@unitydev457 The moment I saw "Use dontDestroyOnLoad" being referenced as a solution to keeping Singletons around from scene-to-scene in the official documentation, it was a bad code smell all over. It felt like a hack, but an officially required one. It's useful for niche things, but I don't use it for anything important.

  • @IgorAherne
    @IgorAherne 7 ปีที่แล้ว +2

    23:40 One issue with SO is their size :s ugh, they are even larger than Monobehaviors

    • @richardfine5502
      @richardfine5502 7 ปีที่แล้ว

      What makes you think that?

    • @IgorAherne
      @IgorAherne 7 ปีที่แล้ว

      I remember each scriptable object is about 5kb if I am right. However, I never actually tested how it would increase the actual build size (if in Resources), just during Editor.

    • @ubermammal
      @ubermammal 7 ปีที่แล้ว +2

      They should be exactly the same size as MonoBehaviours (they're literally the exact same class on the C++ side of the engine). Shouldn't be anywhere close to 5kb unless your class definition is very big...

    • @IgorAherne
      @IgorAherne 7 ปีที่แล้ว +7

      I did several tests, and made a conclusion that when compiled into the build, expect:
      - a large-sized monobehavior to *shrink* by x12
      - a scriptable object to shrink by x40 times than its size in the project panel
      This means all of our c# code becomes a lot, lot smaller once compiled :D

  • @mohokhachai
    @mohokhachai 7 หลายเดือนก่อน

    Finished it

  • @pmoneyish6869
    @pmoneyish6869 ปีที่แล้ว

    To me it almost looks like it's like an interface and then you're making specific implementations of said interface and attach those to components.

  • @magnusm4
    @magnusm4 3 ปีที่แล้ว

    This can work amazingly well with state machines and custom mod support.
    It supports functions as well. Meaning you can make an interface with scriptable objects to add functions to for example, transition to certain states.
    The ScriptableObject can hold all the stats, animation and conditions and any custom npc, enemy or feature can simply tell the other player's state machine to enter into their state they've made in a scriptableObject.
    I love open mod support that's flexible, powerful, just like in game content and easy to use for anyone.

  • @renzocoppola4664
    @renzocoppola4664 7 ปีที่แล้ว

    This time I got this thing about Scriptable Objects. This is a real use case. Though it trumps the idea of having totally independent components.

  • @FoxHoundUnit89
    @FoxHoundUnit89 2 ปีที่แล้ว

    Me watching this video with absolutely no idea what it means for all of my scripts to be monobehaviors

  • @denielalain5701
    @denielalain5701 2 ปีที่แล้ว

    By not making a constructor to ScriptableObject, it is more consistent to remember to.😁

  • @MinhNguyen-kb1ps
    @MinhNguyen-kb1ps 4 ปีที่แล้ว

    thank you for the very informative talk, I want to ask why we may need to create instance of the scriptableobject (in the the demo case, they are GameSetting and GameState), storing json saved data in to these newly created instance instead of just put these data on the scriptableobject asset file on the hierachy? When he called the properties Instance for the both class, he did look for the asset file. Maybe because of avoiding asset searching which might be performance consuming?

  • @Rovsau
    @Rovsau 3 ปีที่แล้ว

    at 19 seconds I pause the video and break down in laughter
    10/10 intro xD

  • @hanniffydinn6019
    @hanniffydinn6019 6 ปีที่แล้ว

    I have no idea why script objects weren't there from day 1 in unity

  • @sabatheus
    @sabatheus 6 ปีที่แล้ว +5

    That ranged float with the custom property drawer is so good, it should be built into the Unity Editor.

    • @parkerneufeld753
      @parkerneufeld753 6 ปีที่แล้ว

      anyone have functioning version of this?

    • @mprades8621
      @mprades8621 6 ปีที่แล้ว +1

      It works by building a Custom Editor and using EditorGUILayout.MinMaxSlider.

    • @Zer0kx
      @Zer0kx 5 ปีที่แล้ว +1

      For anyone looking for a workaround, I like using two normal ranges for that.
      First one is the default value, second one is the deviation from the selected value.
      You don't get that total minimum and maximum though, like if you shouldn't go below 0, yet you could put 0 in the default value and 1 in deviation and end up in -1 so you need to clamp the values in your code.
      But yeah the ranged float is really nice.

    • @Ziplock9000
      @Ziplock9000 5 ปีที่แล้ว +1

      It is

  • @dweebosupremo5904
    @dweebosupremo5904 3 ปีที่แล้ว

    rip headphone users.

  • @TheAudioCGMan
    @TheAudioCGMan 4 ปีที่แล้ว

    oh god very nice.

  • @alejmc
    @alejmc 6 ปีที่แล้ว

    How do you handle a switch statement using ScriptableObjects as enums?
    Finding a workaround with fluent style functions (i.e Switch.On(currentState).Case( /* list of lambda functions here as a selector*/))... but seems convoluted.

    • @mastercovodich
      @mastercovodich 6 ปีที่แล้ว +3

      yo!
      you can't switch object ( SO is object )
      example you define the enum is SOkey : ScriptableObject , use it as enum, create some in the project.
      you can store the whole enum you just created in a dictionary dict
      then, any script wanna use the enum just call
      Get(SOkey key) {
      if(!key) return null;
      return dict(key); }
      with this you just use the enum and get what you want using a dictionary, not switch.
      hope my workaround is good, if you think of better ways can share with me, thanks.

    • @IDontReadReplies42069
      @IDontReadReplies42069 ปีที่แล้ว

      the point of SO is to get away from enums and switch statements.

  • @entertainmentoverloaded5700
    @entertainmentoverloaded5700 3 ปีที่แล้ว

    very nice

  • @FacePalmProduxtnsFPP
    @FacePalmProduxtnsFPP 7 ปีที่แล้ว

    Very fascinating topic

  • @limch08
    @limch08 6 ปีที่แล้ว

    Thanks for the great tips!

  • @sendark001
    @sendark001 7 ปีที่แล้ว

    Awesome talk!

  • @Illu07
    @Illu07 7 ปีที่แล้ว

    RangedFloat? MinMaxRange?
    Why can't i use these things?

    • @MrKraignos
      @MrKraignos 7 ปีที่แล้ว

      In case you didn't figured out yet, they are just custom-made structures, with Editor code to tweak them in the Inspector. See for example :
      bitbucket.org/richardfine/scriptableobjectdemo/src/9a60686609a42fea4d00f5d20ffeb7ae9bc56eb9/Assets/ScriptableObject/Audio/RangedFloat.cs
      and for the editor :
      bitbucket.org/richardfine/scriptableobjectdemo/src/9a60686609a42fea4d00f5d20ffeb7ae9bc56eb9/Assets/ScriptableObject/Audio/Editor/RangedFloatDrawer.cs

  • @DingoAteMeBaby
    @DingoAteMeBaby 2 ปีที่แล้ว +2

    Really missed his chance to say "Tank You"