var headers unity code example
Example 1: unity add sections to a list
using UnityEngine;public class Example : MonoBehaviour
{
[Header("Health Settings")]
public int health = 0;
public int maxHealth = 100; [Header("Shield Settings")]
public int shield = 0;
public int maxShield = 0;
}
Example 2: unity separator in inspector
using UnityEngine;
public class Example : MonoBehaviour
{
//Use this PropertyAttribute to add a header above some fields in the Inspector.
[Header("Hi there!")]
//Space between variables
[Space(10)]
//Attribute used to make a float or int variable in a script be restricted to a specific range.
//public RangeAttribute(float min, float max);
[Range(5,9)]
public string playerName = "Unnamed";
}