Part 5 - Custom Inspector 3 | Unity Editor Scripting Tutorial

preview_player
Показать описание
This video covers the new method of writing Custom Inspectors using Serialization. This method is essential to writing inspectors that works correctly for prefabs and to enable multi object editing.
Рекомендации по теме
Комментарии
Автор

The best playlist of Editor scripting in Unity. Waiting for your new videos! :)

dimavavilov
Автор

I watched your videos a few years back when I was first learning how to do custom inspectors. They helped me out alot and were the only source of information that I could find informative and easy to understand. I haven't touched editor scripting since, but even now the same applies! Thanks so much :)

foodlover_
Автор

I think I found a way you can have the full GUI customization while saving everything properly to prefabs and such. Instead of having the GUI elements based directly on the properties, make them based on variables stored in the editor script. You can initialize them to the values in the Player and then assign the serialized properties to those variables. So you end up writing something like:

string tempName = player.playerName;
tempName = EditorGUILayout.TextField("Name", tempName);
playerName.stringValue = tempName;

Are there any drawbacks to this method that I'm not seeing?

Kellexx
Автор

Is there a way to run another object's public function like unity button does on click? So you can drag and drop an object and run their public script in run time

gladiumcaeli
Автор

You can use the normal styling. You just need to use the serialized objects value. Do something like this...
serializedObject.Update();
var progress =
progress.floatValue = EditorGUILayout.Slider("Slider", progress.floatValue, 0, 1);
EditorGUI.ProgressBar(rect, progress.floatValue, "Progress");

thoughtchow
visit shbcf.ru