JavaScript Inspector Editor question

Hello everyone.
I am a Korean student .
I am studying the Unity custom editor.
Custom editor is very difficult .
Because most of the references are in English.
My English skills are very low.
So I need your help.

My Ask

42070-qa.jpg

I want the result to the right of the above image .
I’ll show you my javascript .

SomeScript.js

#pragma strict

var testObject:GameObject[];
private var visibleObject:GameObject[];
var showObjects:boolean;

SomeScriptEditor.js

#pragma strict

@CustomEditor (SomeScript)
public class SomeScriptEditor extends Editor 
{
   
    function OnInspectorGUI()
    {
       	DrawDefaultInspector();
       
		var myScript : SomeScript = target;
		if(myScript.showObjects)
		{
			EditorGUILayout.HelpBox("Please Help Me" , MessageType.Info);
		}				
	}
	
}

What add in the above script?
How do I get the results of the right image above?
I need your help.
Please help me.
Thank you.

Hello, there is a working example here Hide/Show properties dynamically in inspector. - Unity Answers

The changes you need in your code:

  • Add var i : int = 1; to SomeScript.js

  • The IF-CONDITION and STATEMENT in SomeScriptEditor.js

    if (myScript.showObjects)
    {

    myScript.i = EditorGUILayout.IntSlider(“I field:”, myScript.i , 1 , 100);

    }