Custom Editor Issue.. Need Help!!

Hi Unity Programmers,
I am getting some issue after implementing my own Unity Inspector for a Mono derived class.
Please see attached Pic before:

I have a game object named “CUBE” with a attached script “SingleTaskHandler”. I have a List with variable “InteractionList” (which is again Mono derived class) in it.

I have added reference of 4 scripts of “InteractionBase” class, but my custom editor shows the name of GameObject “CUBE” on all four list items instead showing scripts name “InteractionBase”.

I am using below code to Draw single List Item:

 m_interactionListRef[interfIndex] = (InteractBaseClass)EditorGUILayout.ObjectField("   Interface " + interfIndex, m_serialTaskHandler.TaskData.m_interactionListRef[interfIndex], typeof(InteractBaseClass), true);

So, My Question is: How can i change reference name in my custom GUI Editor to script name i attached to it?

Hi Guys, need help here…

I was trying to understand what your asking but I just can’t seem to get it. I’m pretty good with Editors…

So you want the name to display InteractionBase?

** I understand now… You want the script that you attach to it. Which is a rather odd thing honestly. I’ll think about how this might be able to happen.

Hi Ereous ,
Yes i would like to display my script name “InteractionBase” instead of “CUBE” in all four references in attached picture.

So this is kind of what I came up with… I don’t think you can completely replace the Object that you choose but you can choose what to display before it… So I just do a Horizontal() then get the type and put that before the game object link itself.

float thirdOfScreen = Screen.width/3-5f;
		for( int i = 0; i < tar.m_interactionListRef.Count; i++)
		{
			EditorGUILayout.BeginHorizontal();
			EditorGUILayout.LabelField(" Interface " + i + ": " + tar.m_interactionListRef[i].GetType().ToString(), GUILayout.Width(thirdOfScreen*2));
			tar.m_interactionListRef[i] = (InteractionBase)EditorGUILayout.ObjectField("", tar.m_interactionListRef[i], typeof(InteractionBase), true, GUILayout.Width(thirdOfScreen)) ;
			EditorGUILayout.EndHorizontal();
		}

Thanks Ereous ,
You just gave me an Idea to solve my problem… Thanks man.