Game.UI.Editor.EditorPrefabEditorTool
Assembly: Game
Namespace: Game.UI.Editor
Type: public class
Base: EditorTool
Summary:
EditorPrefabEditorTool is a small EditorTool implementation used by the editor UI to provide a "Prefab Editor" tool. It declares a stable tool identifier (kToolId) and, when constructed, configures the base EditorTool's id, icon and panel by obtaining or creating the PrefabEdítorPanelSystem from the provided Unity.Entities.World. The class itself contains no runtime logic besides this initialization and relies on the base EditorTool for behavior and lifecycle.
Note: the panel system referenced in the constructor is PrefabEdítorPanelSystem (contains an accented i) — this may be an intentional type name in the codebase or a typographic/encoding artifact; ensure your project contains a matching system type.
Fields
public const string kToolId = "PrefabEditorTool"
Constant identifier for this tool. Use this value when referring to the tool by id (for registration, lookup, or serialization).
Properties
- This class declares no new properties.
It assigns inherited properties from EditorTool in the constructor: - id (string) — set to "PrefabEditorTool".
- icon (string) — set to "Media/Editor/EditPrefab.svg".
- panel (some panel/system reference) — set to the PrefabEdítorPanelSystem instance retrieved/created from the World.
Constructors
public EditorPrefabEditorTool(World world)
Constructs the tool and initializes base.EditorTool fields:- Sets base.id to "PrefabEditorTool".
- Sets base.icon to "Media/Editor/EditPrefab.svg".
- Sets base.panel by calling world.GetOrCreateSystemManaged
().
The constructor requires a Unity.Entities.World instance so it can retrieve or create the UI panel system used by the tool.
Methods
- This class defines no methods of its own. It inherits behavior and lifecycle methods from EditorTool. Any interaction, update or input handling is expected to be implemented by the base class or the associated panel/system (PrefabEdítorPanelSystem).
Usage Example
using Unity.Entities;
using Game.UI.Editor;
// obtain or receive a World instance (from the game's runtime)
World world = /* get world */;
// instantiate the prefab editor tool
var prefabEditorTool = new EditorPrefabEditorTool(world);
// prefabEditorTool.id == "PrefabEditorTool"
// prefabEditorTool.icon == "Media/Editor/EditPrefab.svg"
// prefabEditorTool.panel is the PrefabEdítorPanelSystem instance from the world
// register or add the tool to your editor/tool manager as required by your mod/framework
// e.g. ToolManager.Register(prefabEditorTool); // pseudo-code, adapt to your project's tool registry
{{ Additional Notes
- Ensure the assembly that defines PrefabEdítorPanelSystem is available and referenced; the constructor relies on World.GetOrCreateSystemManaged