Skip to content

PrefabTool

Extends: Tool < Object

Description

The tool used to edit the prefabs.

Accessed by Global.Editor.Tools["PrefabTool"].

Properties

OptionButton set
ItemList list
Dictionary preview

Methods

void SetSet ( int index )
void OnSelectPrefab ( int index )
void Instance ( )
void Forget ( )
void Clear ( )
void Confirm ( )

Property Descriptions

  • OptionButton set:
    The UI button that allows the user to select a set of prefabs.

  • ItemList list:
    The UI list that allows the user to select a prefab.

  • Dictionary preview:
    The preview of the prefab created by Instance() with the keys being the reference to the asset instances and their values being their type as an int.

Method Descriptions

  • void SetSet ( int index ):
    Called by the UI when the user changes a set to update the prefab list.

  • void OnSelectPrefab ( int index ):
    Called by the UI when the user selects a specific prefab and instances it as a preview. Calls Instance().

  • void Instance ( ):
    Creates a new instance of a prefab and sets it as the preview property.

  • void Forget ( ):
    Deletes the currently selected prefab (not the instance) from the list.

  • void Clear ( ):
    Deletes the current prefab instance (the preview).

  • void Confirm ( ):
    Make the preview prefab permanent and records its Undo history.