I have a button click that calls this function.
public void InsertEmoji(string text)
{
Debug.Log("Inserted EMOJI");
//UIButton.current = null;
Insert(text);
//Hack because the camera is not clearing this selection
UICamera.selectedObject = null;
//Reselect the input
OnSelect(true);
UpdateLabel();
}
Sometimes after I click the button, I click the chat box and press enter to submit the text. This function gets called again for some odd reason. I just wanted to note this in case you might find a simple reason why it's happening. For now my fix is to manually set the UICamera.selectedObject to null as you can see in my code. That seems to fix the issue. Here is my stack trace.
Consortya.ChatInput:InsertEmoji(String) (at Assets\NGUI_Consortya\Scripts\ChatInput.cs:34)
Emoji:InsertSmile() (at Assets\NGUI_Consortya\Scripts\Emoji.cs:38)
EventDelegate:Execute() (at Assets\NGUI\Scripts\Internal\EventDelegate.cs:476)
EventDelegate:Execute(List`1) (at Assets\NGUI\Scripts\Internal\EventDelegate.cs:644)
UIButton:OnClick() (at Assets\NGUI\Scripts\Interaction\UIButton.cs:257)
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UICamera:Notify(GameObject, String, Object) (at Assets\NGUI\Scripts\UI\UICamera.cs:1079)
UICamera:ProcessTouch(Boolean, Boolean) (at Assets\NGUI\Scripts\UI\UICamera.cs:1851)
UICamera:ProcessOthers() (at Assets\NGUI\Scripts\UI\UICamera.cs:1602)
UICamera:Update() (at Assets\NGUI\Scripts\UI\UICamera.cs:1262)