- Home /
GUI Text Field keeps resetting when trying to type in Text
I seem to be having a bit of a problem getting a TextField editable in the inspector. I have gotten it to display and it also seems to be connected properly to the public property I declared in my action script as well as being referenced properly in the spawning method as I am not getting any compiler errors.
The only problem I still have is that whenever I enter any text into the text field on the inspector it disappears when I click away (or even when I press enter).
Im sorry, Im quite a noob at programming so its proabably something very stupid I am doing wrong.
Here are my code snippets to help you get a better image of the whole scenario:
Definition of public string property in main Action script: public string PoolName;
Using public string property in the spawning method of main Action script: Transform NexProjectile = PoolManager.Pools[PoolName].Spawn(projectile.transform, transform.position, transform.rotation);
Declaring it in the Editor script: public SerializedProperty PoolName;
Calling it up in the void method of the Editor script: PoolName=this.serializedObject.FindProperty("PoolName");
Assigning it to the inspector in the Editor script: EditorGUILayout.TextField("Pool Name", aS.PoolName);
Please any help on the matter would be greatly appreciated, as I dont know where or what I am doing wrong and cant seem to figure out just how to make the Text Field editable.
Thanks in advance for any and all help and advice.
Answer by XMachinaX · May 11, 2014 at 05:18 PM
Nevermind got it working thanks to the following post:
http://answers.unity3d.com/questions/215693/i-cant-edit-my-textfield.html
Again a huge thanks to the Unity community (hehe, never get tired of saying that).
Your answer
Follow this Question
Related Questions
EditorGUILayout.EnumPopup giving me errors 1 Answer
GUILayout.BeginHorizontal sluggish in custom inspector 0 Answers
SceneView.onSceneGUIDelegate GUI sorting problem 1 Answer
Custom Editor - Is there any way to detect whether the user is in Prefab editing mode? 1 Answer
How to update a EditorGUILayout Textfield value in realtime? 0 Answers