Version: 5.5
public bool isFocused ;

説明

InputField は現在フォーカスが当たっていて、イベントを処理することができます。

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 = Color.green; } } }