Fight That OCD (CUSTOM INSPECTOR Unity)

  Рет қаралды 22,227

SpeedTutor

SpeedTutor

Күн бұрын

In this video we will create a custom inspector in Unity. We'll focus on Serializing our fields and properties so we can access private fields. Create dropdowns, toggles, hidden content and showing more when using an enum. We'll look at spacing, labels and more! Do leave any comments if you have any suggestions for making this better! :)
🎁 Get OVER 225+ scripts & projects on my PATREON:
➡️bit.ly/SpeedTut...
➡️Full List: tinyurl.com/ST...
·························································································
➡️(My Game) Left Alone on Steam: tinyurl.com/Lef...
🔥SpeedTutor Unity Store: bit.ly/STUnity...
🔥 INSANE UNITY SAVINGS: bit.ly/UnitySa...
🕹️Unity Sales: bit.ly/UnitySa...
🕹️Quick-Start Bundle: bit.ly/UnityQu...
🕹️Weekly Publisher Sale (+FREE Asset): bit.ly/WeeklyP...
🕹️Unity New Release Discount Sale: prf.hn/l/BdvEmg3
🔥 INSANE HUMBLE SAVINGS: bit.ly/HumbleB...
🕹️Unity Epic Worlds Asset Bundle: tinyurl.com/Uni...
🕹️Unreal Environment Mega Bundle: tinyurl.com/38b...
🕹️World Building & AI Bundle: tinyurl.com/Ga...
🕹️Creative Sandbox Games Bundle: tinyurl.com/Cr...
🔥 FANATICAL GAMEDEV BUNDLES: fas.st/t/HYxySc2q
🕹️Fanatical Bundle Savings (+20% OFF): bit.ly/Fanatic...
🕹️TopDown RPG 2D Assets Bundle: tinyurl.com/Top...
🕹️Dark Worlds Music Bundle: tinyurl.com/Dar...
🕹️Game Design Assets Bundle: tinyurl.com/56x...
🔥Synty Discounts & Savings: bit.ly/SyntyLo...
🔥Unity Pro Deals: bit.ly/UnityPr...
🔥Topcashback: bit.ly/Topcash...
·························································································
💰BIG DISCOUNTS on my website, for my UNITY ASSETS:
➡️www.speed-tuto...
💬Join the Community Discord:
➡️ / discord
💝 Make a donation to the channel:
➡️www.paypal.me/s...
·························································································
⬇️ SpeedTutor Puzzle Assets:
🧩Unity Store: bit.ly/STUnity...
🧩My Website Discounts: www.speed-tuto...
························································································
⭐ Connect with me:
💬| Discord: / discord
🐦| Twitter: / speedtutor
📱 | Facebook: / speedtutoruk
🖥 | Website: www.speed-tutor...
·······················································································
#SpeedTutor #Unity #CustomInspector

Пікірлер: 61
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Let me know if you have any tips or tricks for customizing your inspector! I think it's a great way to save yourself time and MAKE THINGS LOOKS BEAUTIFUL! 🕹Unity's Asset Refresh Sale: bit.ly/UnitySalesHub 🕹BRAND NEW Quick-Start Bundle: bit.ly/UnityQuickStartBundle 🕹My Unity Store Assets: bit.ly/STUnityStorePuzzlePacks
@caden5936
@caden5936 Жыл бұрын
Great tutorial! But dang Unity needs to make this way easier imo, I hope one day they make it a simple property attribute
@SpeedTutor
@SpeedTutor Жыл бұрын
Haha, I think this is why they've tried to add UI Toolkit but I had a look in to it a couple of months back and honestly looked more confusing. Haha.
@TheGrimmy
@TheGrimmy 2 жыл бұрын
Ahh! This is the one you were talking aboot. Love it!
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Haha, it's a lot to take in and is quite faffy but once you've got some custom inspectors going. It really neatens things up :)
@TheGrimmy
@TheGrimmy 2 жыл бұрын
@@SpeedTutor Oh yeah, it looks SOOO much better. I had a GameData savefile essentially that I already sorted from where each data gets used and such, and now it's all neatly stacked and closed off. It's SO darn good now. Like tabs in a filing cabinet, haha. Thank you so much for this :D
@Sam4Progress
@Sam4Progress 10 ай бұрын
It took me a minute to figure out how to apply this to my script, but once I did, this tutorial was exactly what I had spent the past 6 hours looking for! For those that werent immediately clear: If you want to stack a bunch of stuff in the Check Box, just delete the outer layer of code he wrote! Works like a-charm if that's your preference!
@SpeedTutor
@SpeedTutor 10 ай бұрын
Thanks for sharing, my friend! :) I really appreciate it and I hope it will help others out too.
@IceForgeOfficial
@IceForgeOfficial 2 ай бұрын
Love the tutorial! Quick and concise but explains enough to understand!
@SpeedTutor
@SpeedTutor 2 ай бұрын
Glad you found it useful, what are you creating?
@IceForgeOfficial
@IceForgeOfficial 2 ай бұрын
@@SpeedTutor Well, I’m not really that good of a developer but I’m trying to develop a new game. I love this tutorial by the way, I know I said it already, but thanks for creating this video it is super useful for the game dev community :)
@MEGANIKITASIGMA
@MEGANIKITASIGMA Ай бұрын
I LOVE YOU BRO I DONT UNDERSTAND YOU LANGUAGE BUT I INDERSTAND ALL THE MATERIAL
@SpeedTutor
@SpeedTutor Ай бұрын
Haha, I'm glad. Good luck with your projects! :D
@IceForgeOfficial
@IceForgeOfficial 2 ай бұрын
You were putting “SerializeProperty” on each variable separately. You can also use the shortcut of holding down Shift+Alt then select all lines you want to edit.
@SpeedTutor
@SpeedTutor 2 ай бұрын
Thanks for the tip, my friend! :)
@deadbroadcastpc
@deadbroadcastpc 2 жыл бұрын
Mannnn your projects are probably so clean and organized, some really useful info yet again, thanks brother!
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Haha, is it spaghetti junction up in there? :P
@deadbroadcastpc
@deadbroadcastpc 2 жыл бұрын
@@SpeedTutor no way, it’s hard enough to find things with clean code....spaghetti has been off the menu awhile now lol
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Spaghetti is over-rated anyway!
@MatthewPatterson-nr2gh
@MatthewPatterson-nr2gh Жыл бұрын
I will add, just because it wasn't explicitly said: In order for the editor script to work, each property in the original component script needs be prefaced with ` [SerializeField] `. It was shown in the intro but wasn't verbally emphasized. Otherwise, love this video, thank you so much. I've always wanted to beable to make user friendly inspectors and scene/object setups. I understand the appeal of Odin, it IS really nice. However, I really appreciate knowing how to do this by hand because if I want to create a package the sell on the asset store, I wouldn't want to force the user to buy another package before being able to use mine.
@SpeedTutor
@SpeedTutor Жыл бұрын
You're exactly right, my friend. I wanted to use Odin myself but there is no way to have the custom inspector saved without the need for Odin installed. I learned this in exactly the same way as you. I love using "EditorGUILayout.LabelField" - It can create really nice headings with a dark backing, I don't think I showed it in this video. Good luck with all your stuff! :))) Also if you wanted to create a button in the inspector which lets you open the custom editor script for the current script which uses it you can use something like this: void OpenEditorScript() { if (GUILayout.Button("Open Editor Script")) { string scriptFilePath = AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(this)); AssetDatabase.OpenAsset(AssetDatabase.LoadAssetAtPath(scriptFilePath)); } } I hope these help! :D
@syluxdev
@syluxdev 2 жыл бұрын
Odin inspector is the best tool to make editors easily
@SpeedTutor
@SpeedTutor 2 жыл бұрын
I've got the asset but I've never used it myself, is it really good? Needless to say, I make a few different assets and I obviously can't bundle odin with it to make the inspector. So I wanted to show how I've done it a few times. Thanks for commenting! :)
@aeroniix1489
@aeroniix1489 4 ай бұрын
Underrated.
@SpeedTutor
@SpeedTutor 4 ай бұрын
I hope you found it useful! :D Are you creating something cool?
@gojarz7127
@gojarz7127 Жыл бұрын
Thanks, it's so useful and also easy to understand!
@SpeedTutor
@SpeedTutor Жыл бұрын
I'm glad you've found it useful, thanks for watching my friend! :)
@wtflolomg
@wtflolomg 2 жыл бұрын
Odin for the win... along with ScriptableObjects, these two things have revolutionized my development workflow.
@SpeedTutor
@SpeedTutor 2 жыл бұрын
I'd agree on the SO part! As for Odin, I need to try this out myself. I've got it but never used it. How good is it /10?
@TopShelfCookieJar
@TopShelfCookieJar 2 жыл бұрын
@@SpeedTutor It's reeeeally good ie 10/10. Makes doing what you've done here super easy, just by scattering a few attributes in your existing scripts. It's the first thing I install in every project. That said, it's only useful if everyone using your code has Odin eg in your project team or people who download your assets, so it's not a one size fits all solution. In an ideal world Unity would buy them out and we'd live happily ever after...
@wtflolomg
@wtflolomg 2 жыл бұрын
@@SpeedTutor I would say @ledshok sums it up nicely. Odin just makes it extremely easy to make new editor windows and things like action buttons.
@SpeedTutor
@SpeedTutor 2 жыл бұрын
I think you're both right. Rather than Unity making ridiculous acquisitions and laying off lots of staff recently, if they could have bought some genuinely useful like Odin. It would be amazing because I'd love to have more decent attributes added. Thanks for the information ledshok! As I say, I can't use it unless others have access to it and it doesn't really make sense for me to use on a daily basis otherwise. Although I'm definitely going to look into it, then I can cry at how easy it is! :P
@gmangman123
@gmangman123 2 жыл бұрын
good video again! Thx my friend.
@SpeedTutor
@SpeedTutor 2 жыл бұрын
No worries dude! :)
@courtneyleinonen7767
@courtneyleinonen7767 2 жыл бұрын
Instead of setting some variables to public and other to private, I would suggestion using properties instead. Something like: '[field : SerializeField] public bool exampleBool { get; private set; }' This way, there's no chance of accidentally setting a variable somewhere you didn't mean to.
@SpeedTutor
@SpeedTutor 2 жыл бұрын
That's a great idea!
@Patricebrouh
@Patricebrouh 9 ай бұрын
Thank you so much. It's so helpful
@SpeedTutor
@SpeedTutor 9 ай бұрын
You're very welcome! :D What are you looking to make?
@MuhammadBilal-cs3dg
@MuhammadBilal-cs3dg 10 ай бұрын
Really helpul
@SpeedTutor
@SpeedTutor 10 ай бұрын
I'm glad you found it helpful! :D
@glitchover9894
@glitchover9894 10 ай бұрын
Super
@syzg
@syzg 2 жыл бұрын
Can you enable the closed caption, please? I am Deaf.
@SpeedTutor
@SpeedTutor 2 жыл бұрын
They're enabled by default, as long as you click the little button on the KZbin player. I can enable them myself. I hope you get to watch it, thanks for checking this out! :)
@syzg
@syzg 2 жыл бұрын
@@SpeedTutor it was greyed out but now it is on, thank you!
@SpeedTutor
@SpeedTutor 2 жыл бұрын
I guess it just takes time to appear! Thanks for sticking with it, my friend! :)
@aurealis2041
@aurealis2041 2 жыл бұрын
thank you
@SpeedTutor
@SpeedTutor 2 жыл бұрын
You're very welcome, thanks for checking this out! :D
@さしあたりのない名前
@さしあたりのない名前 9 ай бұрын
nice!
@SpeedTutor
@SpeedTutor 9 ай бұрын
Thanks very much! :)
@hassanshahzad7357
@hassanshahzad7357 Жыл бұрын
hmm soo the data we mentioned in inpector will be save rgiht ? and If we put on every object data will be accordingly...
@SpeedTutor
@SpeedTutor Жыл бұрын
The inspector saves as it normally does, apart from if you've hidden some fields then you may need to use EditorPrefs to save whether you've dropped down or not.
@ray1997
@ray1997 2 жыл бұрын
I'm not sure if nameof() feature work, but OnEnable() when finding property you can use playerType = serializedObject.FindProperty(nameof(playerType)); The code seems longer and felt redundant, but it's better for when the time you want to rename property, it would show up error which is not the case for FindProperty("playerType")
@SpeedTutor
@SpeedTutor 2 жыл бұрын
That's a pretty awesome suggestion! Thanks for that. You do get some very unhelpful error messages if a field or property is removed and not accessible anymore.
@ray1997
@ray1997 2 жыл бұрын
oh and btw.. Pressing CTRL+R twice on property will rename it and all its reference on Visual Studio, as you know.. That property inside nameof() will get rename too, so you don't have to comeback and update it 😳
@SpeedTutor
@SpeedTutor 2 жыл бұрын
The more you know! Thanks, my dude. Really awesome pointer, right there!
@devarshpatel73
@devarshpatel73 Жыл бұрын
Hello I really liked the video and the information given is great but I'm getting an namespace error whenever I try to build the apk, I hope that someone can provide me with its solution if anybody else also facing this kind of issues.
@Ozzy89CZ
@Ozzy89CZ 4 ай бұрын
Useless because it works UnityEditor only...
@SpeedTutor
@SpeedTutor 4 ай бұрын
I'm not sure where else you expected a custom Unity editor inspector to work?
@hbcck
@hbcck 2 жыл бұрын
Firstly, thank you for video, I really liked. How can I show a list? [SerializeField] public List Tiles = new(); EditorGUILayout.ObjectField(Tiles); is not working
Easy Editor Windows in Unity with Serialized Properties
10:57
Game Dev Guide
Рет қаралды 101 М.
Watch This Before Working on a Big Game in Unity
18:44
John Leorid
Рет қаралды 301 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
Making a custom inspector using UI Builder (Easy) | Unity Tutorial
15:23
Sasquatch B Studios
Рет қаралды 16 М.
Be CAREFUL with Scriptable Objects!
8:27
Code Monkey
Рет қаралды 86 М.
GPU Resident Drawer In Unity 6 (Improve CPU performance)
6:37
SpeedTutor
Рет қаралды 3,2 М.
How to make a CUSTOM INSPECTOR in Unity
11:47
Brackeys
Рет қаралды 276 М.
11 Things You (Probably) Didn't Know You Could Do In Unity
13:49
Game Dev Guide
Рет қаралды 157 М.
Unlocking The Power Of Unity's Scriptable Render Pipeline
21:05
Game Dev Guide
Рет қаралды 228 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,6 МЛН
Unity Performance Tips: Draw Calls
4:24
Lofi Dev
Рет қаралды 201 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН