Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SpaceAttribute

Use this PropertyAttribute to add some spacing in the Inspector.
Read time 3 minutesLast updated 5 days ago

Definition

[AttributeUsage(AttributeTargets.Field, Inherited = true, AllowMultiple = true)]public class SpaceAttribute : PropertyAttribute

Remarks

The spacing is done using a DecoratorDrawer.

Examples

using UnityEngine;public class Example : MonoBehaviour{ int health = 0; int maxHealth = 100; [Space(10)] // 10 pixels of spacing here. int shield = 0; int maxShield = 0;}

Fields

Value

Description

heightThe spacing in pixels.

Constructors

Constructor

Description

SpaceAttribute()Use this DecoratorDrawer to add some spacing in the Inspector.
SpaceAttribute(System.Single)Use this DecoratorDrawer to add some spacing in the Inspector.

Inheritance

Inherited Members