Unity Custom Inspector

preview_player
Показать описание
-~-~~-~~~-~~-~-

Custom Inspectors are a great way to change not only the look, but the feel of components in your Unity projects. Here is a quick example of how to start creating them.

--------------------

--------------------
GEAR I USE:

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

Of all the tutorials avaiable on Youtube I must say you have the BEST content, by far. Well produced, well narrated (no hmming) and to the point. Thank you for your good service, and God bless you Sire!

PedroLarock
Автор

Good vid, I just had a lecture at uni about extending the unity editor and custom inspectors, this was an easier to follow tutorial.

wizardsofscript
Автор

BurgZerg, you're the amazing tutorial creator!! I recently found your channel and now I cannot stop myself of watching your videos! I'm SO grateful for your outstanding job! (Sorry for my non-ideal English. I hope you understand me =) )

TheNamelessOne
Автор

Thank you for this tutorial, thumb up. 1 tip, if you want a customize c# template already filled by you: Program Templates\81-C# Script NewBehaviourScript.cs.txt, rename this file if anything go wrong you have a backup, make a new one with your namespace and stuff you wanna at start c# script, save it. Will save you some time and trouble. Good luck to all!

Gear
Автор

For organizing a GUI like that (not that I've done this, but I've done similar things in C#) is to take advantage of the #region and #endregion precompiler directives. Most C# editors will allow you to collapse these region blocks, and will only display that region line (with Visual Studio displaying only what comes AFTER the #region directive). No idea if MonoDevelop does that or not (again, never done it), but if it worked the same as VS, I would organize my sections like that. Keeps it as clean and efficient as possible when collapsed, and you're not wasting time with unnecessary stack pushes, pops, calls, and returns in the code.

nychold
Автор

Thanks for the tutorial kind sr! And greetings from Argentina. If you ever come to this part of the world, you are entitled to an asado.

mauriciopartnoy
Автор

If anyone has trouble with values which you entered not being saved or reset when you change scenes in Unity 5.6, here is how I got it to work:
In the OnInspectorGUI function you have to write "serializedObject.Update()" at the beginning.
Then comes the code for the GUILayout stuff, after that write "Undo.RecordObject (c, "Name");". Instead of "Name" you can choose any name you want. This just saves the scene when you modify anything.
Then at the end write ();".
Hope this helps :D

smjonas
Автор

Is there a way to iterate trough all variables all call the default editor? I only wish to customize one off them all, I don't wan't to reimplement them all.

EduardoBonfandini
Автор

for fast for loop creation in VS, type "for" and then press "Tab" two times.

MehrdadGTa
Автор

Very good video.

Is there a way to see the source code? Not for copying, of course, but when I watch tutorials like this, I like to watch the entire thing, before editing my own code. Reading the code afterwards is a great way to sum up the points.

Either way this really helped, so thank you.

XxjazzperxX
Автор

This is a quite easy and yet a powerful way to manage large data. Thank you so much for the tutorial.
Can you help me in adding a list or an array of GameObjects?

monishvyas
Автор

More tutorial about custom inspector please! :D, thanks for your tutorials anyway, Great Job!

ginanjarnoviawan
Автор

Simple and really helpful. Thanks for the video!

nathanwiles
Автор

I like this tutorial .Simple and clean . waiting more about custom inspector
i have a Question . why i cant paste on Labels

marouaneidd
Автор

Awesome tutorial!
Please continue making videos... :)

abgestaubt
Автор

Which database files are you using? The alignment database etc?

dampiir
Автор

Thank you . It was very good. but i have a problem. when I create alignment with my custom inspector, then reopen unity, it doesn't save.

hossein
Автор

I have a if(GUILayout.Button) just like you and I wanna change the text color when its clicked but the color never changes.... Do you know why??? The button does work but the code inside that IF is just saying " F you"

bellarose
Автор

Im using my own scripts, but i cant figure out a way so the array stays after pressing play :/

do you know a way so it do not disappears after pressing play?

thanks in advice!

itsjrph
Автор

Hi i am new to your tutorials and i actually dont understand one thing. I created scriptable object just like you with the list of my custom class inside, but when i click the script in the unity i see nothing in the inspctor. Its probably really dumb question but i just cant get how it works.

TwoStepshell