ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

Serialize Reference, Serialize Field, Serializable and Scene Serialization in Unity | Unity Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ม.ค. 2024
  • Learn about the newish SerializeReference attribute in Unity, as well as the ins-and-outs of the SerializeField and Serializable attributes and how they relate to scene serialization in Unity. We'll be exploring the Unity YAML scene files as well to get a big picture view of how custom classes get serialized. Finally, we'll take a look at the package SerializeReferenceExtensions to see how we can improve our editor workflow when working with polymorphism and subclasses.
    Background Song: / tutorial-background-mu...
    Samurai Unicorn Discord: / discord
    Unity-SerializeReferenceExtensions: github.com/mac...

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

  • @mertakbulut241
    @mertakbulut241 17 ชั่วโมงที่ผ่านมา +1

    Crystal clear. Thank you sir.

  • @kormsd
    @kormsd 10 วันที่ผ่านมา +1

    omg i love you dude the SerializedReference just opened my eyes and saved me hollyyyy

  • @melted-snow-q9o
    @melted-snow-q9o 22 วันที่ผ่านมา +1

    underrated video, how has this just 405 likes after 6 months?

    • @GameDevelopmentBeyondTheBasics
      @GameDevelopmentBeyondTheBasics  22 วันที่ผ่านมา

      Thank you! The topic is fairly specific so this isn't really a video someone watches for fun nor something beginners would care about. I think a video like this will just linearly grow over time though since it's always going to be relevant. Also, this was my second video and I had about 15 subs when I uploaded it, haha.

  • @slodoco
    @slodoco 5 หลายเดือนก่อน +8

    Yes, please make that finite state machine in inspector video!

  • @m-horth2187
    @m-horth2187 6 หลายเดือนก่อน +8

    Great video! Even being at a level where I'd typically say "yeah of course I know how [SerializeField] works..", this step-by-step testing along with checking the scene file really helps shed some light on what's actually happening, and cements it all together. The later tips in the video about [SerializeReference] will come in handy for some projects I have in mind. Thanks!

  • @christianskwisgaar
    @christianskwisgaar 6 หลายเดือนก่อน +4

    I love your explanation. Sometimes we forget how things works.

  • @mehmedcavas3069
    @mehmedcavas3069 หลายเดือนก่อน +1

    this just saved my game I think. in the past I used structs to save data with enums for types. thanks to this I can create normal classes and now they are serializable which allows me to turn them in to json's easier and save them. Plus I can easily test and setup things in the editor. this extension must be a default important thing in unity

  • @birahe1810
    @birahe1810 7 หลายเดือนก่อน +4

    Again, amazing explanation. Would love to see you explain FSMs. It would be really helpful

    • @GameDevelopmentBeyondTheBasics
      @GameDevelopmentBeyondTheBasics  7 หลายเดือนก่อน +1

      Thank you! I've added FSMs to the list. It might be a bit of a wait before I get to the video since it will require more pre-production than my other videos. It will be a great topic though!

  • @iiropeltonen
    @iiropeltonen 6 หลายเดือนก่อน +4

    Excellent explanation. Thank you.🎉

  • @nicolas29031
    @nicolas29031 6 หลายเดือนก่อน +5

    Great explanation. Subscribed. Keep it up! It would be awesome to see the finite state machine!

  • @machinaexphilip6871
    @machinaexphilip6871 6 หลายเดือนก่อน +2

    wow. finally a great overview with depth and a calm explanation. Thank you!

  • @dustin.2498
    @dustin.2498 6 หลายเดือนก่อน +2

    We need you!!!!! As a beginner, you are the only one who can help a person like me to escape the tutorial HELLLL!!!!
    Great video, btw.

  • @hermanusjohannesbesselaar2499
    @hermanusjohannesbesselaar2499 6 หลายเดือนก่อน +3

    Thanks. This really helped me understand serialized fields a lot better. Hope to see a lot more videos from you!

  • @ImmortalTimothyM
    @ImmortalTimothyM 6 หลายเดือนก่อน +3

    Great video, I have subscribed.

  • @Benndot97
    @Benndot97 5 หลายเดือนก่อน +3

    Such a great explanation! I keep coming back to this as I learn Unity and run into these concepts

  • @elyastigre9867
    @elyastigre9867 6 หลายเดือนก่อน

    Thank you
    I would LOVE to know more about your state machine, even more if the quality of the video matches this one !!

  • @Canals03
    @Canals03 6 หลายเดือนก่อน +1

    First video youtube recommended that's actually really good

  • @Crackoder
    @Crackoder 6 หลายเดือนก่อน

    Nice tutorial and thanks for the tool, not sure what I'd use it for yet, but I think its great to setup stuff on the inspector that way

  • @foo3268
    @foo3268 5 หลายเดือนก่อน +1

    I'm surprised that a completely random video was able to solve an issue I was having like a week ago haha.
    I sacrificed some generics and abstracts due to the very situation you've showed. But perhaps I can reimplement them using some of these attributes.
    Awesome video, really clean explanation.

  • @xXBl0oD
    @xXBl0oD 6 หลายเดือนก่อน +1

    Clear and compact explanation! Looking forward for more future video from you!

  • @problem1O1
    @problem1O1 5 หลายเดือนก่อน +1

    Finally I know the serialized Reference use case.

  • @user-js1oo3tj2k
    @user-js1oo3tj2k 6 หลายเดือนก่อน +1

    Great video!
    Please continue to making these beyond the basics videos. Great concept really.

  • @nameno7032
    @nameno7032 3 หลายเดือนก่อน +1

    Worked with Unity for years, but still don't understand the Serialize Reference feature. Thank you for another beyond the basic tutorial.

  • @mathboy8188
    @mathboy8188 6 หลายเดือนก่อน +1

    ... the video I wish had existed when I first started learning Unity.

  • @tomiczdarko
    @tomiczdarko 6 หลายเดือนก่อน +1

    Love it! Subbed!

  • @nekonyo660
    @nekonyo660 6 หลายเดือนก่อน +1

    QuoteAllPositiveComments();
    Thank you !

  • @ep1417
    @ep1417 3 หลายเดือนก่อน +1

    Finite state machine from this topic is what I would like to see.

  • @Sakach1
    @Sakach1 3 หลายเดือนก่อน +1

    Please make a finite state machine, I want to learn the advance topic more
    keep up the good work! much appreciate

  • @HickyGreen
    @HickyGreen 6 หลายเดือนก่อน +1

    thank you :)

  • @epicmcdude
    @epicmcdude 6 หลายเดือนก่อน

    This is really cool, dude! I'm very curious to know how you do saving and loading with Samurai Unicorn, because while there are plenty of tutorials that show how to save basic items, none show how to save for a feature game. Items that get spawned in the scene, scenes full of references, saving enemies various states/animations/pathing etc. I don't know if that's a video you'd be down to making!

  • @SonnyMakesGames
    @SonnyMakesGames 5 หลายเดือนก่อน +1

    Livesaver, thank you!

  • @pekustudio4935
    @pekustudio4935 4 หลายเดือนก่อน

    This music make it from good tutorial to good sad tutorial 😢😆

    • @GameDevelopmentBeyondTheBasics
      @GameDevelopmentBeyondTheBasics  4 หลายเดือนก่อน

      I was going more for calming and peaceful, lol. Too many gamedev tutorials make Unity seem confusing or hard, so I try to go for a Bob Ross vibe instead.

    • @pekustudio4935
      @pekustudio4935 4 หลายเดือนก่อน

      @@GameDevelopmentBeyondTheBasics i didn't mean it's Bad turorial, you did good job and made it simple, its just the music made my eyes wet 😆

  • @PthreeG
    @PthreeG 2 หลายเดือนก่อน +1

    Unity just asked me what I don’t like the most and I said “not enough beyond beginner learning resources”. TH-cam must have heard me lol

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

    Why you didn't use the SerializableField for the variable ItemName? It's not being saved?
    The [Serializeble] in the class automatically serialize all the variables in the class?

    • @GameDevelopmentBeyondTheBasics
      @GameDevelopmentBeyondTheBasics  25 วันที่ผ่านมา +1

      Because it's a public property so it will get serialized, so long as the class it's on is serialized. You can read more specifics of how serialization works in Unity here: docs.unity3d.com/Manual/script-Serialization.html

  • @TH3Willster
    @TH3Willster 3 หลายเดือนก่อน +1

    I was having a lot of trouble trying to serialize ValueTuple. Any suggestions?

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

      I haven't tried serializing that before, but you can always extend ISerializationCallbackReceiver and try getting it serialized there. The docs have an example about how to do this with a dictionary: docs.unity3d.com/ScriptReference/ISerializationCallbackReceiver.html
      That said, based on this thread, it looks like people have been requesting the feature for almost 6 years now: forum.unity.com/threads/please-let-a-valuetuple-can-be-serialized.552703/

  • @MehmetSarkd
    @MehmetSarkd 4 หลายเดือนก่อน

    I wanted to sub when I saw the channel's name. Do you plan to upload?

    • @GameDevelopmentBeyondTheBasics
      @GameDevelopmentBeyondTheBasics  4 หลายเดือนก่อน

      I would love to have you subscribe! I'm currently wrapping up a video on playing a one off AnimationClip from code (not needing it set up as a state in an AnimatorController). The video is meant as an introduction to the Playables API (the thing Animators and Timeline is built on). I hope to have that video out today or at the very least sometime this weekend.

    • @MehmetSarkd
      @MehmetSarkd 4 หลายเดือนก่อน +1

      @@GameDevelopmentBeyondTheBasics I subbed. it is hard to find advanced unity tutorials

    • @GameDevelopmentBeyondTheBasics
      @GameDevelopmentBeyondTheBasics  4 หลายเดือนก่อน

      New video is out now: th-cam.com/video/qPQkFYt7smk/w-d-xo.html

  • @littleface7060
    @littleface7060 6 หลายเดือนก่อน

    No offense but your hair is quite distracting
    Maybe wear a hoodie or something idk

    • @GameDevelopmentBeyondTheBasics
      @GameDevelopmentBeyondTheBasics  6 หลายเดือนก่อน +4

      I am sorry you can't handle my luscious curls :) I'm hoping with better lighting my hair doesn't flicker with the green screen as much.

    • @macawls
      @macawls 6 หลายเดือนก่อน +3

      I for one think his hair looks magnificent

    • @rize2137
      @rize2137 6 หลายเดือนก่อน +2

      Maybe it's just a case with the lighting :)