Description
The AllowGameObjectSelection
property of the EditorTool
class determines whether regular scene object selection is enabled. When set to true
, the standard selection behavior for scene objects is applied, allowing users to select game objects within the scene as they normally would.
Usage
To use the AllowGameObjectSelection
property, you can get or set its value to control the selection behavior in the editor. This property is particularly useful when developing custom editor tools that need to enable or disable the default selection mechanism based on specific conditions or tool states.
Example
// Example of using AllowGameObjectSelection property
public class CustomEditorTool : EditorTool
{
public CustomEditorTool()
{
// Enable game object selection
AllowGameObjectSelection = true;
}
public override void OnEnabled()
{
// Perform additional setup when the tool is enabled
}
public override void OnDisabled()
{
// Clean up when the tool is disabled
}
}