Description
The MenuIcon
property of the PrefabFile
class specifies the icon that is displayed to the left of the option in the menu. This property is useful for providing a visual representation of the prefab in the user interface, enhancing the user experience by making it easier to identify and select the desired prefab.
Usage
To use the MenuIcon
property, ensure that the ShowInMenu
property is set to true
. This will make the prefab appear in the right-click menu, allowing users to create it. The MenuIcon
should be set to a string that represents the name of the icon to be displayed.
Example
// Example of setting the MenuIcon property
PrefabFile myPrefab = new PrefabFile();
myPrefab.ShowInMenu = true;
myPrefab.MenuPath = "MyPrefabs/ExamplePrefab";
myPrefab.MenuIcon = "icon_name"; // Set the icon name to be displayed in the menu