Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Mastering Editor Scripting in Unity
Rating: 3.4 out of 5(3 ratings)
359 students

Mastering Editor Scripting in Unity

Unlock the power of Unity with our 'Mastering Editor Scripting' course, designed to elevate your game development skills
Last updated 6/2024
English
English [Auto],

What you'll learn

  • Introduction to Editor Scripting: Understanding the fundamentals and importance of editor scripting in Unity.
  • Creating Custom Inspectors: How to create custom inspectors to modify and enhance the Unity Editor interface.
  • Integrating GUI Tools: Using GUI tools effectively to create intuitive interfaces for level editors and tools.
  • Managing Editor Modes: Implementing different editor modes to streamline workflow and enhance productivity.
  • Advanced Gizmos and Handles: Utilizing Gizmos and Handles classes to visualize and interact with game objects in the editor.
  • Custom Property Drawers: Creating custom property drawers to enhance the editing experience for specific game components.
  • Building DLLs: Building and utilizing DLLs to extend Unity's functionality and manage larger projects efficiently.
  • Texture Importer Automation: Automating texture importing processes to standardize asset management.
  • Version Control Integration: Integrating version control systems like Git for collaborative development and project management.
  • Creating Custom Editor Tools: Developing specialized editor tools such as object modifiers and scene management tools to streamline game development tasks.

Course content

3 sections83 lectures12h 2m total length
  • Introduction to Editor Scripting in Unity3:48

    Explore how to extend Unity with the built-in editor scripting API to automate repetitive tasks and build custom tools for a 2D platformer, improving your development workflow.

  • Hello World8:08

    Learn to use Unity's editor scripting API to automate tasks and customize the editor, including tools like the easy object modifier that replaces objects with a prefab while preserving position.

  • Hello World game Object6:39

    Create a Hello World GameObject from the Unity editor menu, observe the creation dialog, and learn to place editor scripts in an editor folder to avoid including them in builds.

  • Building a Test Level9:27

    Create and analyze a test level in a simple 2d platformer to explore editor scripting, using level pieces and prefabs, a level handler scene, and additive scene loading.

  • Building a Test Level Continues8:30
  • Level Script8:36

    Demonstrate level creation by duplicating scene elements, placing the player and props, setting level properties and backgrounds, and introducing a canvas or brush metaphor level creator with grid snapping.

  • Starting the Level Creator Tool6:19

    Create a Unity level creator tool by generating a new scene via code, adding a level object with a level script, and exposing a menu item to automate level setup.

  • More on Starting Creator Tool6:48

    Explore editor scripting in Unity by creating a new level workflow that saves, loads, and clears scenes using editor scene managers and a new level menu item.

  • Introducing Gizmos Class6:47

    Explore the gizmos class to render visual aids in the scene view, including grids and icons, to debug and position level piece prefabs precisely.

  • More on Gizmos Class7:09

    Explore how to use the Gizmos class in Unity to draw and customize editor visuals with OnDrawGizmos and OnDrawGizmosSelected, including setting colors, icons, and simple cubes.

  • Target Example8:23

    Learn to render gizmos with a dedicated editor script and the draw gizmo attribute, using a target example to display a cube at the target's position.

  • Draw Fizmo Sample8:03

    Utilize the gizmos class to draw cubes, spheres, and wire cubes or spheres with on draw gizmos, using center and size vectors, while separating editor scripts from game code.

  • Draw Ray4:58

    Master editor scripting in Unity by drawing lines, icons, textures, and frustums with gizmos, using Gizmos.drawLine and Gizmos.drawIcon, and organizing assets in a gizmos folder.

  • Draw GUIT Texture7:52

    demonstrates drawing textures and gui textures with the gizmos class, including screen rect and optional borders, and drawing a camera frustum using center, fov, min range, max range, and aspect.

  • Gizmos Class9:15

    Implement a gizmo grid in the level class by adding total columns and rows and grid size, and use gizmo drawing methods to visualize level piece prefabs in Unity.

  • Gizmos Class Continues9:43

    Explore how to create and render a dynamic grid in Unity using gizmos, drawing lines for the grid and frame, handling color and transform with on draw gizmos.

  • Writing SnapTo Grid Code7:25

    Implement grid snapping and coordinate conversion in the levels.cs script by adding world to grid and grid to world functions, plus grid bounds checks for 2d level prefabs.

  • More on Writing Snap to Grid Code7:14

    Develop a snap-to-grid script that uses world-to-grid and grid-to-world conversions, and visualize the grid with color-coded gizmos in edit mode to verify proper snapping.

  • Getting Started with Custom Inspectors10:34

    Master custom inspectors in Unity using the Unity Editor API, the Custom Editor attribute, and serialized objects and properties to expose and organize level data in the inspector.

  • Creating The Custom Inspector10:22

    Learn to build a custom inspector in Unity by extending the editor class, overriding inspector GUI, using target or targets, and rendering a data-driven inspector with draw default inspector.

  • Creating The Custom Inspector Continues8:42

    Create and refine a Unity custom inspector to validate inputs, constrain ranges, and manage level resizing by rebuilding the pieces array with editor-only methods and object fields.

  • Level in Spector8:09

    Learn to build custom inspectors in Unity using serialized objects and properties, manage total time and pieces arrays, and implement a level creator with editor GUI tools.

  • Property Drawers10:32

    Explore how to design complex editor interfaces in Unity using the editor gui layout class, mastering begin horizontal and vertical blocks, nesting, and practical draw level size examples.

  • Decorator Drawers10:11

    Explore decorator drawers to control the inspector GUI with property drawers in Unity, using range and multi-line attributes to render sliders and text areas.

  • Decorator Drawers Continues7:21

    Explore decorator drawers and built-in property drawers in the inspector, using context menu attributes, header groups, spacing, and tooltips to organize and access editor scripts in Unity.

  • Creating Custom Property Drawers9:38

    Create a custom property drawer in Unity to render a serializable int seconds field in the inspector, with hms or m:s time formats via a time attribute and editor script.

  • Time Drawers9:20

    Explore creating a Unity editor time attribute and custom property drawers to display total seconds as hours, minutes, and seconds using Editor GUI, serialized properties, and custom inspectors.

  • Level lnspector8:09

    Initialize the level inspector using serialized objects and properties to edit total time and pieces, while leveraging custom editors, inspector GUI, and GUI layout for Unity level creation.

  • Creating The Palette Window10:56

    Create an editor window palette in Unity by deriving from the editor window class and using get window for a singleton palette, showing level piece prefabs for level creator tool.

  • Creating The Palette Window Continues9:19

    Extend the Unity editor by creating a palette window and wiring hotkeys for quick access. Categorize palette items with a simple category script to organize level piece prefabs.

  • Menu Items9:03

    Learn to retrieve prefabs by script using a generic GetAssetsWithScript in the editor utils, leveraging asset database to locate, load, and collect level pieces for a GUI palette.

  • Creating the GUIF11:32

    Create a custom GUI in the Unity editor by adding a tabbed palette window that uses category labels to filter and display the selected category's level piece prefabs.

  • Creating the Tabs7:43

    Assign items to categories and implement a scrollable area with a selection grid, handling empty categories and generating previews via asset preview for the palette.

  • More on Creating Tabs10:34

    Create a tabbed palette in the Unity editor by moving preview generation to the update method and building gui content for a selection grid from categorized items.

  • Integrating Palette with Inspector6:54

    Define a delegate and a static item selected event, trigger it when a palette piece is chosen, and subscribe in the level inspector to update the piece and its preview.

  • Integrating Palette with Inspector Continue6:02

    Subscribe to the palette window item selected event and update the current piece in the inspector, then render the piece preview with editor GUI layout and label fields.

  • Different Editor Modes9:33

    Mastering editor scripting in Unity shows how to customize the scene view for a level creator tool with on scene GUI, handles, and four modes to manage level piece prefabs.

  • Draw Mode GUI10:22

    Master editor scripting in Unity by building draw mode GUI in the scene view, managing tools, modes, and 2D constraints for painting and erasing.

  • Working with Events9:32

    Detect and handle scene view events with Unity's event class, capture mouse position, convert to world and grid coordinates, and implement paint, erase, and edit actions in the level inspector.

  • More on Working With Events10:53

    Learn how editor scripting handles mouse events across multiple modes to paint, edit, erase, and view a level grid by instantiating prefabs, destroying pieces, and updating coordinates.

  • Level Creator5:45

    Master editor scripting by using the level creator to paint grass on a grid, erase mistakes, and customize level pieces through the inspector and interactive sign prefab.

  • Palette Item8:51

    Master palette item editing in Unity by managing item inspected, validating grid bounds, and repainting the level inspector with a custom editor via Editor.CreateEditor for live, mode-driven inspection.

  • Handles Class11:18

    Extend Unity edit mode by using the handles class to reallocate piece positions on a grid, track original positions, and update transforms via scene view handles and GUI methods.

  • Handles Class Continues9:47

    Learn to extend the Unity editor with the Handles class to build a scene GUI for a level creator, apply hide flags to control visibility and editing, and handle events.

  • Using GUI Styles8:26

    Enhance the Unity editor by applying GUI styles and skins to customize the level editor and palette window, creating a dedicated title style with centered alignment and a larger font.

  • Using GUI Styles Continues8:26

    Create a resources folder, load a background texture and font with resources.load, and apply a GUI style to a label; design palette tabs with normal, hover, and selected states.

  • GUI and Tab Style8:30

    Explore how to implement tabbed GUI styling in Unity by creating and configuring GUIStyle states, loading textures and fonts, and applying a custom skin to render the toolbar tabs.

  • Using GUI Skin6:02

    Create and apply a Unity GUI skin asset to style the level creator interface. Load skins via resources, customize fonts and textures, and refactor the Level Inspector for editor styling.

Requirements

  • Familiarity with Unity: Basic understanding of Unity's interface and how to navigate within the Unity Editor.
  • Programming Proficiency: Knowledge of C# programming language fundamentals, including variables, loops, functions, and classes.
  • Unity Scripting: Basic experience in scripting within Unity, including writing and understanding MonoBehaviour scripts.
  • Object-Oriented Programming (OOP): Understanding of object-oriented programming principles, such as inheritance, encapsulation, and polymorphism.
  • Unity Asset Management: Understanding of importing and managing assets within Unity, including textures, models, and prefabs.
  • Version Control: Familiarity with version control systems (e.g., Git) and basic concepts such as commits, branches, and repositories.
  • Mathematics and Physics: Basic understanding of vector mathematics and physics concepts relevant to game development.

Description

Welcome to "Mastering Editor Scripting in Unity"! This comprehensive course is designed to take you from a beginner to an advanced level in creating custom tools and extensions within the Unity Editor. Whether you are a game developer looking to streamline your workflow or a programmer aiming to enhance your Unity skills, this course will equip you with the knowledge and practical experience needed to create powerful, custom editor scripts. You'll start with the basics, progress through intermediate techniques, and finally, master advanced concepts to fully unlock the potential of editor scripting in Unity. Join us and transform your Unity development experience!

Section 1: Editor Scripting in Unity - Beginners

In this section, you will be introduced to the foundational concepts of editor scripting in Unity, a powerful feature that allows developers to extend and customize the Unity Editor to enhance productivity. Starting with simple "Hello World" examples, you'll gradually progress to creating more complex scripts that interact with game objects and help in building test levels. You'll explore the basics of the Gizmos class for visualizing and debugging within the Unity Editor and begin developing a custom Level Creator Tool to streamline your level design workflow. By the end of this section, you'll have a solid understanding of how to use editor scripts to improve your development process in Unity.

Section 2: Editor Scripting in Unity - Intermediate

Building on the foundational knowledge from the beginner section, this intermediate section delves deeper into more advanced editor scripting techniques. You'll learn how to create and manage custom inspectors, property drawers, and decorator drawers to enhance the functionality and usability of your tools. This section also covers the integration of the Palette Window with the inspector and introduces different editor modes and GUI styles. By the conclusion of this section, you will be adept at creating sophisticated editor tools and custom interfaces, making your development process more efficient and tailored to your needs.

Section 3: Editor Scripting in Unity - Advanced

In the advanced section, you will tackle the most complex aspects of editor scripting in Unity. This includes adding build features, working with version control systems like Git, and developing comprehensive object modifier tools. You'll explore the creation of custom search functionalities, prefab replacement systems, and advanced GUI components. This section also covers the distribution of your custom tools, ensuring they are polished and ready for use in larger projects. By the end of this section, you will have mastered the art of editor scripting in Unity, equipped with the skills to create powerful, custom tools that significantly enhance your game development workflow.

Conclusion

By completing this comprehensive course on Editor Scripting in Unity, you will have transformed from a novice to an advanced user, capable of creating sophisticated editor tools and custom workflows. The skills acquired will not only streamline your development process but also enable you to tackle more complex projects with efficiency and confidence. Whether you are an aspiring game developer or a seasoned professional, this course will equip you with the necessary tools to elevate your Unity development experience to the next level.

Who this course is for:

  • Unity Developers: Developers who want to enhance their workflow by creating custom tools and extensions within the Unity Editor.
  • Game Programmers: Programmers interested in automating repetitive tasks and optimizing development processes in Unity.
  • Intermediate Unity Users: Users with a foundational understanding of Unity who want to deepen their knowledge and capabilities within the editor.
  • Students and Learners: Individuals pursuing game development or software engineering careers who want to specialize in Unity development.
  • Professionals in Game Development: Professionals seeking to streamline their workflow and increase productivity through custom editor tools.
  • Technical Artists: Artists with a technical background or interest in scripting who want to create tools to assist in art asset management and scene setup.
  • Indie Game Developers: Indie developers looking to leverage Unity's flexibility by creating tailored tools and workflows for their projects.