Utility Button

Overview

The UtilityButton is a UnityEditor extension that allows you to create macro-like buttons without using scripts.

The UtilityButton is allows you to create buttons that combine multiple process and frequently used functions to improve the efficiency of your development.

You can also assign shortcut keys to the buttons you create.


It is possible to assign shortcut keys to the buttons you create.

  • Buttoning up frequently used functions, assets to open (or select) and scenes to make them favorites.

  • Combining multiple steps into a single button

  • Log the values you want to know while debugging.

Features

  • Combining multiple processes into a single button

  • Execute the MenuItem.

  • Open and select Assete.

  • Execute the Method in the script and change the value (private members can also be accessed).

  • Log output

  • Delay setting

Sample Video

Execute the MenuItem.

Edit button layout

Open Asset

Changing the value in Component

Open the edit window

Select [Tools > Utility Button > Setting] to open the whole edit window.

Edit window for each button, right-click the button

Edit Button

Add and remove

Edit: Toggles the edit view on the button

Copy: Copy the button (Json data)

Paste: Overwrite the copied button

Paste+: Add a copied button

+: Add a button

-: Delete button








Editing Display

Name: The name to display on the button.

Tooltip: Setting of the Tooltip when the cursor is on it

New Line: Move the button to a new line or

Space: the size of the space to the left of the button

Width: Width of the button

Height: Height of the button

Color: Button Color

Font Color: The color of the name

Shortcut Key: Select the key you want to assign to the shortcut key.










When you edit Shortcut

UtilityButtonShortcut.cs is created automatically every time you edit [Shortcut Key], and then the

This is registered as a shortcut for MenuItem.

Editing Process

Add and remove

Copy: Copy the button (Json data)

Paste: Overwrite the copied button

Paste+: Add a copied button

+: Add a button

-: Delete button

Setting the Type of Process

Type is the type of process to be performed.

The types are as follows

None: do nothing

MenuItem: Execute the Unity MenuItem

OpenAsset: Opens the specified Asset.

SelectAsset: Select the specified Asset

Log: Log your settings to a log file.

Delay: Wait for the specified number of seconds

StaticMethod: Runs the specified Static Method.

CompnentMethod: Searches for a GameObject and executes Component's Method.

SetStaticMemberValue: Assign the specified value to Static Menber.

SetComponentMemberValue: Searches for a GameObject and assigns a value to Component

How to set MenuItem

Execute Unity's MenuItem.

Separate the menu item with a / delimiter.

Set [GameObject/3D Object/Cube] as shown in the following image

How to set OpenAsset and SelectAsset

Select the asset you want to open or select.

Set the Asset to open and select the Asset.

Below is the case of OpenAsset.

How to set Log

Outputs Arg values to a Log.

When multiple Arg values are set, they can be combined in a single Log.

Click here to see how to set up Arg in detail.

How to set Delay

Set the waiting time.

Time(Sec): Enter the waiting time in seconds

How to set StaticMethod

Execute the specified Static Method.

Class: Specify the class name including namespace. You can select the classes that match the search after typing.

Method: Method name (you can also access private).

Click here to see how to set up Arg in detail.

The video below shows the Method in the image on the right, where the argument is an int.

How to set CompnentMethod

Specifies the GameObject on the Hierarchy and executes the Method of the GameObject's Component.

GameObject: Specify the name of the Hierarchy's GameObject (you can also specify it with a / separator).

Class: Specify the class name including namespace. You can select the classes that match the search after typing.

Method: Method name (can also be accessed by private).

Click here to see how to set up Arg in detail.

The video below shows the Method with no arguments in the image on the right.

How to set SetStaticMemberValue

Assign the value to Static Member.

Class: Specify the class name including namespace. You can select the class which matches the search.

Member: Member name (private, and you can also access properties).

The value to be assigned is Arg 0.

Click here to see how to set up Arg in detail.

How to set SetComponentMemberValue

Specifies a GameObject on the Hierarchy and assigns a value to the Member of the GameObject's Component.

GameObject: Specifies the name of the Hierarchy's GameObject (or separate it with a / character).

Class: Specify the class name including namespace. You can select the class that matches the search after inputting the name.

Member: Member name (You can also access to private).

The value to be assigned is Arg 0.

Click here to see how to set up Arg in detail.

How to set Arg

Editing Arg

+: Add a button

-: Delete button



Types of Arg

Int: Set an int type value.

Float: Set a float value.

Bool: On/Off for the bool values.

String: Sets the string.

Vector3: Set a xyz float value

Enum: Enum is set to an integer value

Asset: Set the Asset

AssetArray: Set the Asset array.

GameObject: Set the GameObject name in Hierarchy

Component: Set GameObject and Component name.

Component Member: Set the names of the Component and Component members.

Static Member: Set the class name and member name.

How to set Arg

Arg: How to set Int

Enter an integer value in the TextBox

Arg: How to set Float

Enter a real number in the TextBox

Arg: How to set Bool

Check box to toggle true or false

Arg: How to set String

Enter a text in the TextBox

Arg: How to set Vector3

Enter real numbers in the TextBox. From left to right: xyz

Arg: How to set Enum

Enter an integer value in the TextBox. (You cannot set the enum name.)

Arg: How to set Asset

Set an Asset to an ObjectField

Arg: How to set AssetArray

Click the + or - button to increase or decrease an ObjectField.

Set an Asset to an ObjectField.

Arg: How to set GameObject

Specify the GameObject name in the TextBox. (You can also specify it with a / delimiter.)

Arg: How to set Component

Specify the GameObject name in the GameObject TextBox. (You can also specify it with a / delimiter.)

Specify the Component name in the Component's TextBox. You can select a class that matches the search after you enter it.

Arg: How to set Component Member

Specify the GameObject name in the GameObject TextBox. (You can also specify it with a / delimiter.)

Specify the Component name in the Component's TextBox. You can select a class that matches the search after you enter it.

The Member name is specified in the TextBox of Member. (You can also access private. Property is also accessible.

Arg: How to set Static Member

Specify the Class name in the TextBox of Class. You can select a class that matches the search after you enter it.

The Member name is specified in the TextBox of Member. (You can also access private. Property is also accessible.

About copy and paste

Pressing the Copy button saves the Json data to the clipboard.

Press Paste button to paste the Json data if it is correct.