How can I custom inspector a enum like as component Light

Hi,

I want create many different kind of variable foreach value of dropdown list. Sorry my bad english, please look my image in attachment. How can i do it.

Thanks so much.

56540-2015-10-20-19-41-18.jpg

56543-2015-10-20-19-40-59.jpg

Here is my solution, for C#

An exemple test class (your code) :

using UnityEngine;
using System.Collections;

public class MyTestScript : MonoBehaviour {
    public enum ParametersType {
        WithoutParameters,
        WithParameters
    }

    public ParametersType type = ParametersType.WithoutParameters;
    public string testString = "";
    public int testInt = 0;
}

And the your custom UI script, should be in the Editor folder at the root of the Assets folder :

using UnityEngine;
using System.Collections;
using UnityEditor;

[CustomEditor(typeof(MyTestScript))]
public class TestCustomInspector : Editor
{

    public override void OnInspectorGUI()
    {
        MyTestScript script = (MyTestScript)target;

        script.type = (MyTestScript.ParametersType)EditorGUILayout.EnumPopup("My type", script.type);

        if (script.type == MyTestScript.ParametersType.WithParameters)
        {
            script.testString = EditorGUILayout.TextField("Test string", script.testString);
            script.testInt = EditorGUILayout.IntField("Test int", script.testInt);
        }
    }
}

Result :
56550-0-before.png
to
56549-0-after.png