Get A Good Handle With A Custom Editor Tool In Unity

preview_player
Показать описание
In this video I will go back to a topic from another video but give you a new spin for implementing it. We will look at how to manipulate points on a path but this time we will perform those manipulations with a custom editor TOOL rather than just coding it into a custom editor’s scene gui function.

If you would like to support this channel, feel free to donate to:

Previous Video “Tips On Creating A Good Unity Tool”

Asset Links
-------------------
Creepy House

Zombies

Documentation Links
-----------------------------------
Unity Editor Tool

--

Contents:
00:00 - Intro
00:30 - The Scene
01:55 - Writing the editor
07:25 - Coding a shortcut
10:33 - Pretty Icon
13:09 - Outro

#unity #unity3d #unitytutorial #madewithunity #gamesdevelopment

FTC Disclosure: Some links provided are linked to my affiliate account & support the channel at no extra cost to you.
Рекомендации по теме
Комментарии
Автор

Another 14 minutes of video that will save hours of work in future :)

martin-schoen
Автор

Love this! I always seem to find the video that is almost the same thing I'm currently up to and it's great! 😊

On a side note, I've always found Unity's Editor/IMGUI programming model to be kinda awkward/quirky and conducive to some really _ugly_ code evolving just to try to avoid bugs/exceptions ... but I have also found that the newer C# syntax/features supported in Unity help remedy it a _great deal_ ...

You kind of did a similar thing as I do except for something like `!(obj is Path path)` I'd write that as `obj is not Path path` (use `not` instead of ! to negate/flip evaluation) for the more "proper" pattern-matching style. Very simple example, but it really gets interesting/cool when you "pattern-ize" those expressions like:

if( obj is not Path { PointCount: > 2, Mode: not Modes.Whatever, } validPath ) continue ;

else if( validPath is ISomeSpecialKind { Topology: Topology.Curve, Connections: { Count: > 0, Outputs: not null, }, } specialPath ) {
// crazy stuff happens ...
}

It sure beats tons of null checks/guards and "traditionally ugly" Unity code styles haha
🫠

GameDevNerd
Автор

You are really good at speaking. And the video was very well paced. Very glad to see a tutorial video like this one!

Andrewzero
Автор

Welcome back legend! Thank you for another awesome video

divainsyoutube
Автор

Thanks! Did not know about the EditorTool class yet...!

danielmolineromuller
Автор

Supper Helpful explanation of the EditorTool. For path tools I have always cheated in the past by using the Cinemachine Path, I use it in all my projects for the great camera control that it has, Might as well make use of the features it has. I think that in my next project that I need some sort of path in I might use the Spline Tool as they have made it a production package for now. I also took the code from your other video and cobined it with this one so now the path tool only shows one manipulator at a time in the scene view. With round buttons at each point.

jameslafritz
Автор

Big fan of the videos, but one suggestion. Namespacing is important, not only if you are working in a team, making tools, but even working solo, as it helps eliminate unnecessary conflicts and errors with tools you might download from the asset store or other places.

It would be good to encourage and demonstrate this behavior in the tutorials, not only so newer users are exposed to it, but also as a gentle reminder to those who might simply have forgotten to do so in a tool they are making.

mosthed
Автор

Thank you so much for the tutorial but do you know how I could reference A editorWindow script out of a EditorTool script and get the functions and variables out of it

LetuscontinueBlending
Автор

In one of your upcoming videos can you show how to change the icon of scripts/scriptable objects? Also what do you know what size the icons need to be?

andrewpullins
Автор

Nice to see you creating new content again. Btw: is there a workaround for exposing our base class data for modification when using your approach? I tried this tooling class in my sandbox project but it seems that its leads to allowing other classes for modification of fields that normally would be private?

Second topic: if you find some spare time, could you create video, explaining how to create runtime transform tool (rotate, scale, move)?

MarekNijaki