Game.UI.Editor.BulldozeToolPanel
Assembly: Assembly-CSharp
Namespace: Game.UI.Editor
Type: class
Base: EditorPanelSystemBase
Summary:
BulldozeToolPanel is a small editor panel class used by the in-game editor UI to represent the Bulldoze tool panel. It overrides the panel creation lifecycle to initialize the panel state: it clears any child widgets and sets the panel title to the localized key "Editor.TOOL[BulldozeTool]". Both the constructor and the OnCreate override are marked with the [Preserve] attribute to prevent stripping by the engine's linkers.
Fields
- This class does not declare any new fields. It uses inherited members from EditorPanelSystemBase (for example, children and title) which it modifies in OnCreate.
Properties
- This class does not declare any new properties. It relies on properties provided by the base class.
Constructors
public BulldozeToolPanel()
Initializes a new instance of the BulldozeToolPanel. The constructor is empty and marked with [Preserve] to ensure it remains available after build/link time optimizations.
Methods
protected override void OnCreate()
Called during the panel's creation lifecycle. This override:- Calls base.OnCreate() to perform base-class initialization.
- Sets children to an empty array (Array.Empty
()), effectively clearing any child widgets for this panel. - Sets title to the localization key "Editor.TOOL[BulldozeTool]".
Remarks: - The [Preserve] attribute on this method prevents it from being removed by code stripping tools. - The title is a localization key; ensure your localization data contains a corresponding entry if you want a translated display string.
Usage Example
using System;
using Game.UI.Widgets;
using UnityEngine.Scripting;
namespace Game.UI.Editor;
public class BulldozeToolPanel : EditorPanelSystemBase
{
[Preserve]
protected override void OnCreate()
{
base.OnCreate();
children = Array.Empty<IWidget>();
title = "Editor.TOOL[BulldozeTool]";
}
[Preserve]
public BulldozeToolPanel()
{
}
}
Additional notes: - To extend this panel with widgets, override OnCreate and populate the children collection with IWidget instances instead of clearing it. - Because the class is small and primarily driven by the base class lifecycle, most customization will come from adding widgets or overriding other lifecycle methods provided by EditorPanelSystemBase.