I recently upgraded to Unity 5.2.3f1.
Before that I used this script to always move the textcursor to the end of the textfield.
//constrain cursor
var editor : TextEditor = GUIUtility.GetStateObject(typeof(TextEditor), GUIUtility.keyboardControl);
editor.selectPos = typedCommand.Length + 1;
editor.pos = typedCommand.Length + 1;
Where typedCommand
is the String of text being edited in the textfield.
But since my upgrade I get these errors:
'selectPos' is not a member of 'UnityEngine.TextEditor'. Did you mean 'SelectToPosition'?
'pos' is not a member of 'UnityEngine.TextEditor'.
So does this mean that they removed it in 5.2? Why would Unity want to remove something they aren’t working on anymore, and not offer any alternative? Or does someone know an alternative? It’d be great if I didn’t have to downgrade Unity.
Thank you