How to control serialized variables over the inspector pane?

Hello,

SCENARIO :

Lets say that there is a class like using System.IO;using System;class Program : Monobehaviour{ [Seriali - Pastebin.com
And I want to expose the variable StartTime only when the TypeOfState for thisState is Start

How do I achieve this? If the question requires a long answer - please spot me towards a tutorial (prefer) or a resource online
where I could learn that from?

Thank you and I appreciate your time.

Karsnen

You will have to create a custom editor script for that. If you don’t know how to make one, you can easily find many tutorials by a simple Google search. The code to do what you require could be as follows:

if (serializedPropertyOfThisState.enumValueIndex == 0) { //serializedPropertyOfThisState is the serialized property of variable thisState (check SerializedProperty in docs
    StartTime = EditorGUILayout.FloatField(StartTime);
}