Problem exposing public variable to Inspector in C#

Hi

I’ve looked through the posts with a similar problem, don’t seem to deal with what is happening here, well if they do trying the solution proposed hasn’t worked.

I am putting in a public string variable that I wish to expose to the inspector. Basically I am changing a NGUI script putting in the variavle ‘public string objectTagName’ as follows.

[AddComponentMenu(“NGUI/Examples/Drag & Drop Surface”)]

public class DragDropSurface : MonoBehaviour
{

public bool rotatePlacedObject = false; 
public string objectTagName;


void OnDrop (GameObject go)
{
	DragDropItem ddo = go.GetComponent();
	
	if (ddo != null && ddo.tag == "Player")
	{
		GameObject child = NGUITools.AddChild(gameObject, ddo.prefab);

		Transform trans = child.transform;
		trans.position = UICamera.lastHit.point;
		if (rotatePlacedObject) trans.rotation = Quaternion.LookRotation(UICamera.lastHit.normal) * Quaternion.Euler(90f, 0f, 0f);
		Destroy(go);
	}
}

}

I don’t normally use C# and know nothing of it’s little peculiarities. Don’t quite understand why this is not showing though, should be straightforward. Am I missing something? Any assistance would be greatly appreciated.

Yes. The bool was there originally and appears fine. I thought it might have problems to do with the parsing because there were a couple of errors in other scripts, but deleting those scripts changed nothing. The public string fails to appear.

NGUI uses [CustomEditor()] attribute to override default inspector behaviour. You have to find the corresponding file that defines 's editor behaviour and add your newly defined variable there too.