I’m trying to gain access to the getSelectedString function within the InputField.cs file in the UI source code. I’m following the instructions on the bitbucket page on how to put the new .dll file in the Unity editor file structure. All I have done is changed the “protected string GetSelectedString()” to “public string GetSelectedString()”
I did a build and cleared all errors. I put the resulted .dll files from the output folder to the unity editor folder per bitbucket’s instructions.
Now, when I try to call this function in code it will not recognize the function. For instance:
public void HighlightedText()
it errors out not knowing what .GetSelectedString() is.
There are 2 versions of the UnityEngine.UI.dll extension. They are all located under
The second version is inside the Standalone subfolder. I’m not sure what’s different in those two version (they have different filesize) and which one is used in the editor / in a build, but it’s possible that you didn’t replaced the correct one.
Apart from that you can easily access the selected string by using an extension method and implement a similar method that extracts the selected string.
public static class InputFieldExtension
public static string GetSelection(this InputField aField)
if (aField == null)
int start = aField.selectionAnchorPosition;
int end = aField.selectionFocusPosition;
int len = end - start;
if (len == 0)
if (len < 0)
start = end;
len = -len;
return aField.text.Substring(start, len);