hide in the inspector code example
Example 1: unity hide in inspector
using UnityEngine;
public class Example : MonoBehaviour
{
// Make the variable p not show up in the inspector
// but be serialized.
[HideInInspector]
int p = 5;
}
Example 2: unity hide in inspector
[HideInInspector]
public float myVar;