Version: 2017.3
public bool isFocused ;


Does the InputField currently have focus and is able to process events.

using UnityEngine;
using System.Collections;
using UnityEngine.UI; // Required when Using UI elements.

public class Example : MonoBehaviour { public GameObject mainInputField;

void Update() { //If the input field is focused, change its color to green. if (mainInputField.GetComponent<InputField>().isFocused == true) { mainInputField.GetComponent<Image>().color =; } } }