section in inspector 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: section in inspector unity

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;
}

Tags:

Misc Example