コード例 #1
0
    private IEnumerator DisableHighlight()
    {
        //Get original selection color
        var originalTextColor = genericInput.GetSelectionColor();

        //Remove alpha
        originalTextColor.a = 0f;

        //Apply new selection color without alpha
        genericInput.SetSelectionColor(originalTextColor);

        //Wait one Frame(MUST DO THIS!)
        yield return(null);

        //Change the caret pos to the end of the text
        genericInput.SetCaretPosition(genericInput.GetTextLenght());

        //Return alpha
        originalTextColor.a = 1f;

        //Apply new selection color with alpha
        genericInput.SetSelectionColor(originalTextColor);
    }