SpaceAttribute
Use this PropertyAttribute to add some spacing in the Inspector.
Read time 3 minutesLast updated 5 days ago
Definition
- Type: Class
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
- Inherits from: PropertyAttribute
[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 |
|---|---|
| height | The 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. |