Making Your Own Unity Tools - Introduction to Custom Editor Windows - Unity Tutorial
HTML-код
- Опубликовано: 31 июл 2024
- Download the project files from this video - tmg.dev/CustomEditorBasics
🎮 Let me know what other Unity tutorials you want to see 🎮
👇 See below for time stamps 👇
0:00 - Introduction
2:00 - Project overview and tool demonstration
6:42 - Important note about the 'Editor' folder
7:40 - Overview of the C# script
8:38 - Opening the custom editor window
9:25 - Adding the editor window to the menu bar in Unity
10:13 - GUI Layout Label
10:40 - Editor GUI Layout Text Field
11:12 - Editor GUI Layout Int Field
11:28 - Editor GUI Layout Slider
12:01 - Editor GUI Layout Float Field
12:12 - Editor GUI Layout Object Field
13:04 - GUI Layout Button
13:27 - Spawning the Object
13:44 - Wrap up and final demonstration
Resources:
Unity EditorGUILayout documentation: docs.unity3d.com/ScriptRefere...
Please 'Like' this video and share it with anyone who is interested in video game development.
Subscribe to the channel for much more independent video game developer related content including tutorials, design breakdowns, industry events, VLOGs, and much more fun stuff!
Links:
Blog:
turbomakesgames.com
My Game Development Studio's Website:
homecookedgames.com
My GitHub:
github.com/JohnnyTurbo
Music by: Joakim Karud / joakimkarud
My Setup:
Camera - Yi Action Cam - amzn.to/2FSRxLk
Webcam - Logitech C922x Pro - amzn.to/2HTinFp
27" 4K Monitor - Asus PG27AQ - amzn.to/2Mkg7X2
Laptop - Asus GL502VS - amzn.to/2FNKiET
Keyboard - Das Keyboard 4 Ultimate - amzn.to/2W7SHZd
Other Keyboard - Ducky One 2 Mini - bit.ly/2I8ivQI
Headset - PlayStation Platinum Wireless Headset - amzn.to/2FR6n58
As an Amazon Associate I earn from qualifying purchases.
#CustomEditorWindow #UnityTutorials #GameToolsProgramming Игры
This is one of the best tutorials I've seen on anything Unity, let alone something as daunting as custom editors. Great delivery style and really well put together example. Thank you!
So glad to hear this, really appreciate the positive feedback!
I guess I am quite randomly asking but do anyone know of a good site to stream newly released tv shows online?
@Jax Shane Flixportal =)
@Maximiliano Aarav Thanks, signed up and it seems like they got a lot of movies there :) I appreciate it !!
@Jax Shane you are welcome xD
Thank you! Perfect tutorial and example for a intro on editor scripting. Loved the object spawner example because it's a good start for what I'm trying to do already. :D
Great to hear! Editor tooling is a really important skill to have. Have fun creating more tools 😀
This is a great example for creating editor tools, many thanks! Just what I needed!
Wonderful, glad to hear this was helpful to you 😀
Very clear and useful tutorial. Thanks for the good work!
So glad to hear this helped you out!!
So much clearer than the official unity tutorial.
Glad to hear this helped you out!!
Absolutely fantastic tutorial, simple, focused and incredibly useful! Thanks!
(4 years ago, where was I? Not where I should have been!)
Haha so glad to hear it still holds up 😊
Your solution works better and with less bugs than , PolyBrush or terrain(paint details) , thx for the introduction to unity editors
Good to hear. Have fun creating more of them!
this video is a great service for the community
Thanks for the high praise 😀
Thank you! I tried myself and I made an automatic hierarchy organizer this is useful
Amazing, thank you!
i would love a complete tutorial series about custom tool creation for a bunch of different situations!
Good to know!
Cool stuff, kudos to you!
Anytime 😁 glad you enjoyed!
Thanks for the tutorial, I'm gonna make a tool for everything.
Once you make your first one, they get addicting and you make them for everything 😁😂
Great tutorial! Thank u a lot!
Awesome, glad it helped!
Very cool and helpful
Awesome - glad to hear!
Thank you, dude!
No problem!
Thank U, man!
Anytime 😀
Very good video!
Thank you very much!
Excellent example.
Glad to hear you found it helpful, thanks!
Great Tutorial. I took it one step further and added "Terrain.activeTerrain.SampleHeight", so the objects are at the correct terrain height.
Awesome! Glad to hear you were able to customize this further to fit your needs
Awesome Tutorial! First time doing editor scripting and it was easy to follow. One note though, isn't this the older IMGUI system? It would be great if you could make a tutorial on the UI Toolkit which is new and much easier to use. Thanks!
Thanks! The IMGUI system has been around since the beginning of Unity and it still works well for simple things. The UI Toolkit is still in preview form right now, but it will be cool see how well it works with custom tools like this.
10/10
Man,i open a new scene and i dont have setting to create game,plz help me
Is there a way to make it spawn with a ray cast? For example, you can turn spawning on or off with a bool, and wherever you click, it casts a ray and spawns the object there?
Yes there is. In fact, my friend Dave just put up an awesome video that shows you how to do just that: ruclips.net/video/k-LbV_zMeI4/видео.html
Hey this is great! I'm really struggling with the advanced features of Editor Windows, would love some help, or a tutorial that goes a bit beyond this. Specifically I want to change characteristics of a GUILayout element after I create it. How can I update the colour of a label or button after I have clicked something in my editor window?
The OnGUI function is essentially a draw call that is ran every frame. So when the user clicks a button, this could set a flag and in your OnGUI, check that flag and set the color depending on the value. Hope that helps!
@@TurboMakesGames Thanks for the reply! Yeah that makes sense. I've since learnt that OnGUI draws UI in a completely diffferent way to how you think about objects in your scenes in Unity. OnGUI doesn't make persistent objects that you can alter later, so any changes to the UI element has to be done before the element is drawn.
hey I am working on something similiar to this is there any way to select a specific position in the scene before spawning stuff?
Great to hear! One approach you could do is have an empty GameObject with a gizmo on it, so you can see it in the editor, then move it around to where you like, then when you spawn your GameObject just get the transform position of that empty object. Hope that helps!
@@TurboMakesGames Okay that makes sense. I am doing something similar. Would have been nice if you could make a right click menu or something that would capture the mouse position in the editor window.
Hi guys, i am interested in finding projects to work on, games, little games, for collaboration with other people that want to create games, on the side from work. Does anyone have any idea where to find something like that?
Unity is launching a new open source project platform. Contributing to that and getting yourself known there would be a great place to start. I'll have a video coming out later this week with more info...
I have an object generator script that I have to play to produce GOs. I made it this to test it out. Now that it works I need to convert it to the editor window because I want the GOs and not in play.
The methods that I have I want to keep as a playable script and use in and editor extension. This looks like a special kind of maintenance to configure. I have Update() and Start() utilized. The classname : Editor and classname : Monobehaviour will cause a differentiation build. I believe I need a script reference in the Editor class to access the MonoBehaviour methods. Not sure how to write the reference line.
I hope I am clear here. Thanks for this video!
Thinking your best option would be to move your custom methods to a static C# class that doesn't inherit from anything. That way you could call these methods from both the Editor and MonoBehaviour scripts. Hope that helps!
@@TurboMakesGames Yes. I came to that realization of the EditorWindow and MonoBehaviour can not talk to each other. Took a while after twisting around in my head. I want to make the methods class a communal DLL. This is what kept me asking how can I achieve this. You hit the nail on the head. Thanks. And oh the DLL goes into managed assemblies library.
Is it possible to include the editor window in the build ? LIke what if I want to handle the spawning in the runtime using the editor window ?
Unfortunately not, anything in the Editor folders are not included in builds. What you could do is extract out the logic in your editor window into a regular C# class file, then call those methods from your editor window. This would allow you to create a runtime UI where you could call those same methods. Hope that helps!
Im unable to create a gameobject field at the beginning, and it is not working with objectfield.
Why not? Is it giving you an error, or is it just not showing up? Do other types of fields (i.e. text field) work?
@@TurboMakesGames Now it's Working!, i'm an intermediate unity developer and started editor coding recently so, there was an issue with visual studio, Fixed it!.👍
Can you please guide me how can I access the Sprite Editor within Sprite Renderer? I actually want to add Normal Maps as Secondary Textures of different sprites using an automated tool like this.
Hey what’s your doing