Custom menus are a great way to offer game developers easy access to your Editor Extension features. Logging actions is a good way to display and keep a record of actions performance and object properties that have been changed. In this recipe, we'll create a new menu for the Unity Editor application and a menu item that when selected logs a simple message:
Menu items to log messages and clear the console
How to do it...
To create a menu with a menu item to log messages to console, follow these steps:
- In the Project panel, create a new folder, Editor.
- In your new Editor folder, create a new C# script-class named ConsoleUtilities.cs, containing the following:
using UnityEditor;
using UnityEngine;
using System.Reflection...