Class RuleOverrideTileEditor
The Editor for a RuleOverrideTileEditor.
Inherited Members
Namespace: UnityEditor
Assembly: Unity.2D.Tilemap.Extras.Editor.dll
Syntax
[CustomEditor(typeof(RuleOverrideTile))]
public class RuleOverrideTileEditor : Editor
Fields
k_GameObjectElementHeight
Height for a GameObject Element
Declaration
public static float k_GameObjectElementHeight
Field Value
Type | Description |
---|---|
float |
k_PaddingBetweenRules
Padding between Rule Elements
Declaration
public static float k_PaddingBetweenRules
Field Value
Type | Description |
---|---|
float |
k_SpriteElementHeight
Height for a Sprite Element
Declaration
public static float k_SpriteElementHeight
Field Value
Type | Description |
---|---|
float |
m_GameObjects
List of GameObjects and overriding GameObjects
Declaration
public List<KeyValuePair<GameObject, GameObject>> m_GameObjects
Field Value
Type | Description |
---|---|
List<Key |
m_Sprites
List of Sprites and overriding Sprites
Declaration
public List<KeyValuePair<Sprite, Sprite>> m_Sprites
Field Value
Type | Description |
---|---|
List<Key |
Properties
overrideTile
The RuleOverrideTile being edited
Declaration
public RuleOverrideTile overrideTile { get; }
Property Value
Type | Description |
---|---|
Rule |
ruleTileEditor
The RuleTileEditor for the overridden instance of the RuleTile
Declaration
public RuleTileEditor ruleTileEditor { get; }
Property Value
Type | Description |
---|---|
Rule |
Methods
DrawCustomFields()
Draw editor fields for custom properties for the RuleOverrideTile
Declaration
public void DrawCustomFields()
DrawGameObjectElement(Rect, int, bool, bool)
Draws the GameObject element for the RuleOverride list
Declaration
public void DrawGameObjectElement(Rect rect, int index, bool active, bool focused)
Parameters
Type | Name | Description |
---|---|---|
Rect | rect | Rect to draw the GameObject Element in |
int | index | Index of the GameObject Element to draw |
bool | active | Whether the GameObject Element is active |
bool | focused | Whether the GameObject Element is focused |
DrawGameObjectListHeader(Rect)
Draws the header for the GameObject list
Declaration
public void DrawGameObjectListHeader(Rect rect)
Parameters
Type | Name | Description |
---|---|---|
Rect | rect | GUI Rect to draw the header at |
DrawSpriteElement(Rect, int, bool, bool)
Draws the Sprite element for the RuleOverride list
Declaration
public void DrawSpriteElement(Rect rect, int index, bool active, bool focused)
Parameters
Type | Name | Description |
---|---|---|
Rect | rect | Rect to draw the Sprite Element in |
int | index | Index of the Sprite Element to draw |
bool | active | Whether the Sprite Element is active |
bool | focused | Whether the Sprite Element is focused |
DrawSpriteListHeader(Rect)
Draws the header for the Sprite list
Declaration
public void DrawSpriteListHeader(Rect rect)
Parameters
Type | Name | Description |
---|---|---|
Rect | rect | GUI Rect to draw the header at |
DrawTileField()
Draws a field for the RuleTile be overridden
Declaration
public void DrawTileField()
GetGameObjectElementHeight(int)
Gets the GUI element height for a GameObject element with the given index
Declaration
public float GetGameObjectElementHeight(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | Index of the GameObject element |
Returns
Type | Description |
---|---|
float | GUI element height for the GameObject element |
GetSpriteElementHeight(int)
Gets the GUI element height for a Sprite element with the given index
Declaration
public float GetSpriteElementHeight(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | Index of the Sprite element |
Returns
Type | Description |
---|---|
float | GUI element height for the Sprite element |
HasPreviewGUI()
Whether the RuleOverrideTile has a preview GUI
Declaration
public override bool HasPreviewGUI()
Returns
Type | Description |
---|---|
bool | True if RuleOverrideTile has a preview GUI. False if not. |
Overrides
OnDisable()
OnDisable for the RuleOverrideTileEditor
Declaration
public virtual void OnDisable()
OnEnable()
OnEnable for the RuleOverrideTileEditor
Declaration
public virtual void OnEnable()
OnInspectorGUI()
Draws the Inspector GUI for the RuleOverrideTileEditor
Declaration
public override void OnInspectorGUI()
Overrides
OnPreviewGUI(Rect, GUIStyle)
Draws the preview GUI for the RuleTile
Declaration
public override void OnPreviewGUI(Rect rect, GUIStyle background)
Parameters
Type | Name | Description |
---|---|---|
Rect | rect | Rect to draw the preview GUI |
GUIStyle | background | The GUIStyle of the background for the preview |
Overrides
OnPreviewSettings()
Updates preview settings for the RuleOverrideTile.
Declaration
public override void OnPreviewSettings()
Overrides
RenderStaticPreview(string, Object[], int, int)
Renders a static preview Texture2D for a RuleOverrideTile asset
Declaration
public override Texture2D RenderStaticPreview(string assetPath, Object[] subAssets, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
string | assetPath | Asset path of the RuleOverrideTile |
Object[] | subAssets | Arrays of assets from the given Asset path |
int | width | Width of the static preview |
int | height | Height of the static preview |
Returns
Type | Description |
---|---|
Texture2D | Texture2D containing static preview for the RuleOverrideTile asset |
Overrides
SaveTile()
Saves any changes to the RuleOverrideTile
Declaration
public void SaveTile()