No video

Easy Editor Windows in Unity with Serialized Properties

  Рет қаралды 100,732

Game Dev Guide

Game Dev Guide

Күн бұрын

Пікірлер: 124
@gonzaloescamilla8488
@gonzaloescamilla8488 4 жыл бұрын
Please, it would be awesome if you could create more detailed videos on how to create custom editor in Unity.
@vincentp9673
@vincentp9673 4 жыл бұрын
i would really like a tutorial playlist on a more or less "full" game of GameDevGuide
@TiimedArts
@TiimedArts 4 жыл бұрын
The information from the video is enough to program your own custom editor. You just need your own ideas lmao
@dragonboyx123
@dragonboyx123 4 жыл бұрын
@@TiimedArts To be honest, I found this a bit confusing. Some of the things I wanted to learn from the video, he skipped them. I have ideas, but I need someone to teach me about how to operate the Editor.
@shadmansudipto7287
@shadmansudipto7287 3 жыл бұрын
@@dragonboyx123 that's how this channel is man, he's got even worse videos where he doesn't show the code at all for shaders and doesn't share the project files either.
@kaleb_t4818
@kaleb_t4818 3 жыл бұрын
@@dragonboyx123 did you find any thing useful ?
@Dizastrophe
@Dizastrophe 4 жыл бұрын
Would love a more in depth video showing all the different kinds of things you can do!
@wasteurtime5677
@wasteurtime5677 Жыл бұрын
watched this video 3 years ago. Had no idea how to do any of this. Now i'm making my own tools. Thank you for inspiring me 😭😭
@geoffreyhendrikx
@geoffreyhendrikx 5 жыл бұрын
I just found this channel and i love it already. You explaining everything very well.
@BenjaminK123
@BenjaminK123 4 жыл бұрын
i love your videos, you pack so much into 10 minutes but at the end of it you know the process and personally i do revisit your videos allot and slowly work my way through them but that first time watch is like a strong hit of coffee and taste so dam good.
@marche4ever
@marche4ever 2 жыл бұрын
i like how you show the problem you encounter first, then present a solution, very well-made video!
@iamjohnhult
@iamjohnhult 3 жыл бұрын
Did no one else see that comment at 1:24? "Change these fuckers". A game dev in my liking.
@TheWalruzz
@TheWalruzz 4 жыл бұрын
While I usually hate video tutorials (I prefer to visually scan text tutorials to save me time) your videos are truly amazing and straight to the point. And even though I rolled out my own solutions to some of the problems you give tips for, I always find something new to learn and improve upon in my project after watching your guides. 10/10 would recomend to anyone making their indie games
@jack4law
@jack4law 5 жыл бұрын
Awesome video as ever! I love the explanation before the main tutorial started... Improved my understanding of what I was going to learn. Good job!
@rofosaurus3758
@rofosaurus3758 3 жыл бұрын
You just blew my mind mate.
@BeeGameDev
@BeeGameDev 4 жыл бұрын
This is excellent and just what I needed. Also, I feel like you managed to condense some of the 40+min impenetrable tutorials down into just 10 minutes. Time saver! Cheers!
@MichaelFurmedge
@MichaelFurmedge 4 жыл бұрын
High quality video dude, I really appreciate the time you're taking to make these.
@limitless6572
@limitless6572 2 жыл бұрын
I just found you, amazing tutorials. Subscribed!
@meteturkay
@meteturkay Жыл бұрын
I always find you when i most needed, you're best
@raycodes7393
@raycodes7393 2 жыл бұрын
I've been looking for this for a week now ARRRGH Thank you!
@322ss
@322ss 5 жыл бұрын
Thank you! Probably couldn't have been able to come up with such a neat solution without this video... insightful stuff. I've only managed to find few articles about using SerializedObjects...
@paulthompson52
@paulthompson52 3 жыл бұрын
Would like to see more videos from you on this subject...really awesome work!!
@nafurachan9061
@nafurachan9061 4 жыл бұрын
would you cover how to build those node editors? That looks that it'd be immensely useful! Thanks for the videos!
@GreenClover0
@GreenClover0 3 жыл бұрын
I have the impression that we are quite similar. I like to create systems that I can improve later on. I think I like it even more than the game development itself. So I'm glad I found this channel by accident while working on my first custom editor. Keep up the good work
@anaibrahim4361
@anaibrahim4361 4 жыл бұрын
Didn't find what to see Exactely what i was looking for thanks soo much You gave it in fantastic presentation
@akilaakila7312
@akilaakila7312 2 жыл бұрын
I find the legendary developer teacher
@elektra81516
@elektra81516 4 жыл бұрын
This is why I use Unity over anything else, love custom editors!
@teemuleppa3347
@teemuleppa3347 3 жыл бұрын
Unity is not the only engine that allows this
@silverfoxstudio4452
@silverfoxstudio4452 3 жыл бұрын
So this is the video that every AssetStore publisher watch for make a editor window
@euriherasme
@euriherasme 3 жыл бұрын
Thank you so so so so much, this and every single one of your tutorials are really awesome, I cannot thank you enough!
@HadiLePanda
@HadiLePanda 4 жыл бұрын
Really useful for organizing, thanks for the tutorial!
@eneziofilho5312
@eneziofilho5312 2 жыл бұрын
You just destroyed all my doubts, thanks 🤘
@jean-michel.houbre
@jean-michel.houbre 3 жыл бұрын
Thank you for this very interesting video. I took a big step in my discovery of editor scripts, but I think I'll have to review it again ^^
@Andrew90046zero
@Andrew90046zero 4 жыл бұрын
I would like to see how you made some of those node graphs in the intro. If you did actually make those. or other magical looking editors that you've made.
@awesomedata8973
@awesomedata8973 5 жыл бұрын
This is great, but it should really show how to make the ScriptableObject list of classes. Maybe provide some details?
@GameDevGuide
@GameDevGuide 5 жыл бұрын
Hey, so there's a Discord server for the community linked in the description which was set up for follow ups on videos such as this, and to discuss video topics in more detail. We're also actually discussing this over there too, so you might find it useful. Feel free to join if you wish to get involved. 😊
@blincey
@blincey 4 жыл бұрын
This video was exactly what I was looking for! I would really love it if you went into more detail about the individual features of the Unity Window editing; or other such features :)
@ChristianRoyUtah
@ChristianRoyUtah 5 жыл бұрын
Wow! I love this! Thank you!
@ryancassidy3033
@ryancassidy3033 5 жыл бұрын
Great stuff, man. Definitely going to try to utilise this!
@arthur-monteath
@arthur-monteath 7 ай бұрын
I love your channel!
@RobinPortnoff
@RobinPortnoff 4 жыл бұрын
Thanks, Matt for all the great tutorials. I saw your event sequencing tool whizzing by at the start of the video. Any plan for a tutorial on node-based tools? I would greatly appreciate it!
@lesthodson2802
@lesthodson2802 2 жыл бұрын
1:23 "CHANGE THESE FUCKERS" I see what you did there. :D
@potatoking5602
@potatoking5602 3 жыл бұрын
This whole video is very meta, very useful too tho
@ramonmelo2799
@ramonmelo2799 4 жыл бұрын
Super nice! Thanks for the tutorial ! :)
@gonzaloescamilla8488
@gonzaloescamilla8488 4 жыл бұрын
I just fouund this channel. Its Amazing!"!!
@MDSky
@MDSky 3 жыл бұрын
8:20 that looks good, but if you could be so kind as to exsplain how to change the boxes background colours that would help alot.
@RickMcMichael
@RickMcMichael 3 жыл бұрын
Any chance that you could release the source code so I can check my files? The use case isn't related to mine Specifically trying to use this type of window to open from a "Menu" item and grab all of its value so I can further sort groups separated by headers and change them more easily.
@ecthoart3815
@ecthoart3815 4 жыл бұрын
How would I get this to work with a ScriptableObject that is not set up as an array?
@LuisVasquezVega
@LuisVasquezVega 3 жыл бұрын
Did you find a solution? I make it work but serialized values inside nested groups are getting draw in the sidebar.
@asrielmandrak7220
@asrielmandrak7220 4 жыл бұрын
The editor is blank. It does not draw anything. In fact, even the button does not appear in inspector.
@owendugmore1057
@owendugmore1057 4 жыл бұрын
Great video. Is it just me, or is custom editor scripting not very well documented in the official Unity docs?
@DonDisainer
@DonDisainer 2 жыл бұрын
great info!!! tnx a lot!!!
@Sean-hd1bp
@Sean-hd1bp 4 жыл бұрын
Wow! This is so useful!
@simoncodrington
@simoncodrington 4 жыл бұрын
Awesome video mate. Haven't seen many editor / gui unity videos. Keen on seeing what you come up with next.
@victorgonzalezrivera6806
@victorgonzalezrivera6806 4 жыл бұрын
I have a problem in 6:17 where you put the string parameter "gameData" in findProperty, I dont understand what are you referring with that. Hope you can answer me. Thank you so much for the vid!
@TheRandomCS
@TheRandomCS 4 жыл бұрын
Its the name of the list in his game data class, you can see the inspector for it at 2:32. The signature being something like 'List gameData'. You want the lower case version since that's the variable name.
@__dane__
@__dane__ 2 жыл бұрын
I wish there were more videos about property drawers instead of editor windows. Way more often than not I want to display properties in within existing editor windows
@tae6175
@tae6175 3 жыл бұрын
Me just learning Unity and have basic C# knowledge watching this video: yeah.. I have no idea what's he talking about.
@Senayoshy
@Senayoshy Жыл бұрын
this is me right now so im just copying his script and seeing if it works. spoilers: it doesn't
@tae6175
@tae6175 Жыл бұрын
@@Senayoshy 😂relatable
@DamienPup
@DamienPup 4 жыл бұрын
how do you make it so you can chage the amount of elements in a array?
@logan4179
@logan4179 3 жыл бұрын
Nice tutorial, but I felt a bit lost. I can't find any good, authoritative videos/courses on Unity editor scripting that go from the ground up. Were there any that you learned and would recommend, or did you just have to piece together info from what you could find?
@riekumar6999
@riekumar6999 2 жыл бұрын
Is there a video on how to manipulate scene objects in an editor window? I would love to create an event sequencer.
@feliscape
@feliscape Жыл бұрын
When I add a new object to the list via a gui button it doesn't update the sidebar. How can I fix this? The button operates on a reference to the scriptable object assigned when opening the window.
@sandwich9560
@sandwich9560 4 жыл бұрын
For those wondering how to refresh the Editor Window(the field being edited will not change it values) when you clicked on the sidebar button, protected void DrawSideBar(SerializedProperty prop) { foreach (SerializedProperty p in prop) { if (GUILayout.Button(p.displayName)) { _selectedPropertyPath = p.propertyPath; //Add this EditorGUIUtility.editingTextField = false; } } if (!string.IsNullOrEmpty(_selectedPropertyPath)) { SelectedProperty = SerializedObject.FindProperty(_selectedPropertyPath); } }
@mg6554
@mg6554 Жыл бұрын
please can you explain to me what is the gameData on line 17 GameDataEditorWindow
@Rajivrocks-Ltd.
@Rajivrocks-Ltd. 4 жыл бұрын
Very insightful video!
@LuizMoratelli
@LuizMoratelli 4 жыл бұрын
Please, do more videos about of it.
@hemanthadapala6910
@hemanthadapala6910 Жыл бұрын
how did you created those buttons "Play&Simulate", "Mission Control" and "Scene Collections" if anyone knows how to do that ?
@Gers217
@Gers217 5 жыл бұрын
How do I change the number of elements of my ScriptableObject?
@AmanKumar-tu2og
@AmanKumar-tu2og 4 жыл бұрын
Add this to the end of DrawProperties Method if (GUILayout.Button("Add Item")) { prop.InsertArrayElementAtIndex(prop.arraySize); } if (GUILayout.Button("Remove Item") && prop.arraySize > 0) { prop.DeleteArrayElementAtIndex(prop.arraySize - 1); } EditorGUILayout.EndHorizontal(); And, Add these to the start and end of OnGUI method in the customeditorwindow : > serializedObject.Update(); currentProperty = serializedObject.FindProperty("propertyname"); DrawProperties(currentProperty, true); > serializedObject.ApplyModifiedProperties();
@TheMadMuffin
@TheMadMuffin 2 жыл бұрын
I tried to follow this tutorial but my data isnt a list called gameData, I have no idea how to translate any of this to fit the shape of MY data. Can someone explain how to make this work for any other content that isnt a list called gameData?
@jonahmcconnell4818
@jonahmcconnell4818 2 жыл бұрын
I just worked through the tutorial and from what I can tell it requires a bit of modification either way working in versions after the one the video was recorded in (though I'm not sure). This Discord in the description does have channels specifically for this sort of help if you need it.
@francyleomatos7104
@francyleomatos7104 4 жыл бұрын
Please create more videos related to EditorWindown, how to put timeline and components please, please, please, please!
@shannonblack1394
@shannonblack1394 Жыл бұрын
nice easter egg at 1:24😅
@realog7692
@realog7692 2 жыл бұрын
I want to edit inspector things in in-game setting like Controlling poset possessing with toggle or camera view distance
@davidkokoski4392
@davidkokoski4392 2 жыл бұрын
Also, in case I wasn't the only one confused about the lastPropertyPath check thing (the "stop child properties from being drawn over iteration") and ALSO ran into the exact problem I did with the array/collection elements within the list we are currently trying to slap into our editor window repeating itself just like he said we were trying to avoid (I have a list within the list I'm trying to draw here), here is was I found out: TLDR: Add lastPropertyPath = p.propertyPath; inside foreach (SerializedProperty p in prop) { if (p.isArray == true && p.propertyType == SerializedPropertyType.Generic) { ... My poor explanation of why: (1) The idea behind the lastPropertyPath check in the else statement of DrawProperties is that it a) checks that the lastPropertyPath has been set somewhere (by checking that it isn't empty like we initialized it to be) and b) checks that the latest property path we looked at in the last loop (hence the name lastPropertyPath) we were working with is actually contained in the property path we are looking at right now. The idea behind b) is we are trying to see if the current property's path (the p.propertyPath) shows that it is a "child" of the lastProperty path we drew. If it is, that means it must be a child of an array/collection. NOTE: This assumes that lastPropertyPath ALWAYS contains the path of the last property we were looking at in the loop, so we can always compare the current property path (p.propertyPath) to the previous property path (lastPropertyPath). So, if the lastPropertyPath happened to be that of an array/collection, and the current property path CONTAINS that exact path within it, that means the current property path MUST be a child of a collection! If that is the case, it should have already been drawn in the previous if statement (we are in the else statement now), so we want to avoid redrawing it as if its a singular property (which is exactly what the code AFTER this check does for you if your property isn't a child of anything and is just a good old fashioned non-collection-related SerializedProperty). Boom! That explains how that whole "stop child properties from being drawn over iteration" is supposed to work. HERE IS WHY I found out the code didn't do that very thing I explained it was going to do... The Problem: We only assigned lastPropertyPath in two places: (1) when we initialized it to be empty before entering the foreach loop and (2) when we were in the case that the current property wasn't related to a a collection at all (that whole lastPropertyPath = p.propertyPath after the check we described with the "continue"). We never assigned lastPropertyPath when we were dealing with an array/collection! That means lastPropertyPath will never ever correspond to a collection, which means the check that is meant to see if the current property path contains an array's property path will never work. Your lastPropertyPath will never be that of a collection. Because of that, we will never be able to check b) properly. It's whole point is to see if the current property's path shows its a child of a collection, which is found out by seeing if the property's path contains the last collection's path. The simple fact is, lastPropertyPath needs to hold up to its name of always containing the propertyPath of the last property we were looking at, whether it satisfies p.isArray or not. So... TLDR... just make sure lastPropertyPath is being assigned inside the if(p.isArray == true ...) part of the foreach loop, as well as every other possible part. Phew, that was a lot of words. Like I said, "poor explanation" XD
@nove1398
@nove1398 3 жыл бұрын
How Do I populate the the list though?
@dahiyabunty1
@dahiyabunty1 4 жыл бұрын
sir.. do you have project on github???
@pokebytes
@pokebytes 2 жыл бұрын
Such a helpful tutorial thank you! Question tho, I got everything working and I have a list of "SkinComplexes" and each of them contain scriptable object class "Skin". When I click on the button then all the Skin values are shown and I can put Skin scriptable object in it. Now I want similary to get "Skin" properties displayed if I have assigned it but I have tried so many things and still can't access those properties. Do you have any ideas how I could access them and display them?
@minecraftermad
@minecraftermad 4 жыл бұрын
how would i go about setting the names for the buttons that are drawn? currently i'm trying to just find a property with the name "name" and set it's value as the name if it's a string... but it seems kind of jank
@badrballish9328
@badrballish9328 3 жыл бұрын
Thank you very much.
@minecraftermad
@minecraftermad 4 жыл бұрын
for me the edited values revert the changes made to the object when switching between editor and playmode i've tried: Undo.RegisterCompleteObjectUndo(ObjectThatWasModified, "update Paths"); and in a custom editor gui i've tried to do: serializedObject.ApplyModifiedProperties(); i've also tried calling the custom editor from the editor window with a handle with both of those on.
@JacobSmith-ts2gq
@JacobSmith-ts2gq 4 жыл бұрын
try calling setdirty when you change the values it should refresh the info
@minecraftermad
@minecraftermad 4 жыл бұрын
@@JacobSmith-ts2gq isnt set dirty deprecated?
@JacobSmith-ts2gq
@JacobSmith-ts2gq 4 жыл бұрын
@@minecraftermad dont know, but it i had the same problem in one of my projects and it worked
@JacobSmith-ts2gq
@JacobSmith-ts2gq 4 жыл бұрын
also if you are referencing custom classes they should have a [System.Serializable] ubove it
@invntiv
@invntiv 4 жыл бұрын
How is this channel not massive
@dirt410
@dirt410 Жыл бұрын
how should i structure my data so that this works? no matter how many times i've tried to implement this it never works for me. something is always broken. Either arrays and lists duplicate themselves or they don't show up at all. and if i try to add the sidebar, none of the fields show up. i'm completely lost.
@feliscape
@feliscape Жыл бұрын
I had a similar issue, and it seems to be because I was using nested scriptable objects. You need to use a serialized class for it to work. This is how my class looks: [System.Serializable] public abstract class CutsceneAction { public string name; public float duration; public abstract IEnumerator Play(); } This shows up properly
@kyanrowse4150
@kyanrowse4150 3 жыл бұрын
Is it possible to use this to change the element name. So if i have an array floats in the inspector i don't have element 0, element 1 etc I can put a name so if someone who doesn't know about the scripts contents can just take one look and be like hey that's what that array index is for.
@TESkyrimizer
@TESkyrimizer 4 жыл бұрын
That was the greatest thing I have ever seen. Holy crap.
@dominiauk
@dominiauk 5 жыл бұрын
Brilliant stuff.
@benayamanuel
@benayamanuel 3 жыл бұрын
Hey man, just got frustated because all my editor scripts (basically all scripts in Assembly-C#-Editor.dll) couldn't find other classes that sit on Assembly-C#.dll. (missing a directive or assembly reference) My editor scripts created just few weeks ago and they did just fine. But this morning this bug showed up and all my editor code is dead. Bcs they couldn't find the base class. Any idea on this ? Thanks
@silverfoxstudio4452
@silverfoxstudio4452 3 жыл бұрын
Why you don't zoom the ide ?
@AllDayBikes
@AllDayBikes 3 жыл бұрын
"Change these fuck**s" nice haha
@thedazzledazz4719
@thedazzledazz4719 3 жыл бұрын
I know this is years old so I probably wont get a reply, but how come when other people do this the non editor classes (in this instance "GameDataObject") come up in the autocomplete for others but for me it always comes up with a red line (even though it still works like that, it's annoying to have to repeatedly check the spelling and to manually type out all the functions)... Is there a setting I'm missing somewhere?
@tayyabmujeeb7621
@tayyabmujeeb7621 3 жыл бұрын
can we convert editor window into canvas?
@mdistudio7875
@mdistudio7875 4 жыл бұрын
Hi bro thanks so much for this tutorial, But how can i make array of inheritance classes Ex. Public class base :MonoBehaviour { //some data Public child[] _child [system. Serializeble] Public class child : base { //some data Public subChild _subChild [system. Serializeble] Public subChild : child { //some data } } } And to access them?
@lewaplay
@lewaplay 3 жыл бұрын
I'm trying to do this for 5 days and it still doesn't work
@theman2636
@theman2636 4 жыл бұрын
This is kinda old now why don't you make a video on the same subject but with UIElements
@excelion7109
@excelion7109 3 жыл бұрын
If only GameDataObject was shown for a single frame... but nope.
@tayyabmujeeb7621
@tayyabmujeeb7621 3 жыл бұрын
Any one who can help regarding this?
@nove1398
@nove1398 3 жыл бұрын
[selectedProperty.FindPropertyRelative] this method is not finding the property name that I passed in.
@ruchirraj5300
@ruchirraj5300 3 жыл бұрын
Please make some more editor tool windows
@Shonnyy
@Shonnyy 3 жыл бұрын
"Change these fuckers" lol
@vladisslavss
@vladisslavss 4 жыл бұрын
Great!
@Inf4mousKidGames
@Inf4mousKidGames 4 жыл бұрын
Umm where the heck does currentProperty come from??? it wasnt even defined
@Lelefant_
@Lelefant_ 4 жыл бұрын
It is defined in ExtendedEditorWindow as protected variable, so it can be used in the deriving EditorWindow. (see 7:19)
@Inf4mousKidGames
@Inf4mousKidGames 4 жыл бұрын
@@Lelefant_ I did a dumb I named the variable something else 🤣
@hojaverde5265
@hojaverde5265 5 жыл бұрын
Are you using Odin serializer? I want to get it but I'm not totally sure
@GameDevGuide
@GameDevGuide 5 жыл бұрын
Nope this is just default unity!
@joaniepepin4968
@joaniepepin4968 4 жыл бұрын
Probably late, but I got it at the latest sale and I must say, I am getting way more use out of it than I ever thought I would! Adding a button in the editor with one line of code allows to do so many things that I never would have thought possible and it saves a lot of time in the long run!
@wombatbat6955
@wombatbat6955 4 жыл бұрын
How come I'm only now finding about this channel? This is Brackeys level tutorial!
@TheAdeOfSpades
@TheAdeOfSpades 3 жыл бұрын
Brackeys is for excitable noobs. This is next level. Not many make it to the next level.
@pedroluzio
@pedroluzio 4 жыл бұрын
can you show the contents of "Game Data" ?
@fernandodarci
@fernandodarci 4 жыл бұрын
It´s my doubt too
@jibbyis_2327
@jibbyis_2327 3 жыл бұрын
MY BRAIN HURTS SO MUCH FROM JUST 10 MINUTES
@SLAYERSARCH
@SLAYERSARCH 3 жыл бұрын
10000000000 menu's and all i want is a search button.
@Momonyaro
@Momonyaro 4 жыл бұрын
b r u h
Building A Tutorial in Bolt
11:32
Game Dev Guide
Рет қаралды 20 М.
10 Unity Tips You (Probably) Didn't Know About
8:58
Sasquatch B Studios
Рет қаралды 11 М.
WILL IT BURST?
00:31
Natan por Aí
Рет қаралды 28 МЛН
Or is Harriet Quinn good? #cosplay#joker #Harriet Quinn
00:20
佐助与鸣人
Рет қаралды 8 МЛН
WHO CAN RUN FASTER?
00:23
Zhong
Рет қаралды 46 МЛН
EASY Stats and Modifiers in Unity | Broker Chain Pattern
16:05
A new way to generate worlds (stitched WFC)
10:51
Watt Designs
Рет қаралды 525 М.
Speed Up Compile Times in Unity with Assembly Definitions
9:54
Game Dev Guide
Рет қаралды 89 М.
Making Your First Indie Game (5 Tips for 2021 & 2022!)
8:41
Thomas Brush
Рет қаралды 458 М.
How To Build Roads Procedurally In Unity with the Splines Package
17:51
Can I Run Youtube Entirely From My Terminal? (No Browser)
15:31
Better Coding in Unity With Just a Few Lines of Code
15:27
Firemind
Рет қаралды 307 М.
Making a Modal Window in Unity
10:02
Game Dev Guide
Рет қаралды 61 М.
Using Interfaces in Unity Effectively | Unity Clean Code
4:23
James Makes Games
Рет қаралды 57 М.
Creating a Cheat Console in Unity
9:46
Game Dev Guide
Рет қаралды 85 М.
WILL IT BURST?
00:31
Natan por Aí
Рет қаралды 28 МЛН