I wrote the following script in Unity C#.
Test.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Test : MonoBehaviour
{
public bool showParams = true;
public int test1 = 100;
public string test = "";
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
I want to switch whether other parameters are displayed in the Inspector by turning on/off the showParams variable.
As shown in the image below, when showParams is ON, all variables are public.

As shown in the image below, I want to prevent all variables from being displayed when showParams is OFF.
I want to switch whether other parameters are displayed in the Inspector by turning on/off the showParams variable.
As shown in the image below, when showParams is ON, all variables are public.
As shown in the image below, I want to prevent all variables from being displayed when showParams is OFF.
Is this possible with Unity C#?
