UI Element Got & Lost Focus Handling

I am working on desktop game so that want to move focus using arrow keys.
Default initial button focus, I have already setup. As well by pressing arrow keys controls is also moving from one button to other but I want to set up scale up and down animation.

When button got focus, I want to do scale up for that button. When button lost focus, I want to do normal scale for that button. ← I want to implement this thing.

I found this way but this don’t contains scale up and down feature. This contains sprite change functionality.

For UI setup, I have used new Unity UI, so my all UI controls belongs to that.

This is actually very easy. Just put this on each Selectable Object you wish to scale on Select.

using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.EventSystems;

public class ScaleButton : MonoBehaviour, ISelectHandler, IDeselectHandler{

	Vector2 offMax;
	Vector2 offMin;
	RectTransform myRT;
	void Start ()
		myRT = transform as RectTransform;
		offMax = myRT.offsetMax;
		offMin = myRT.offsetMin;

	public void OnSelect(BaseEventData data)
		myRT.offsetMax = offMax * 1.1f;
		myRT.offsetMin = offMin * 1.1f;
		Debug.Log(gameObject.name + " Selected");
	public void OnDeselect(BaseEventData data)
		myRT.offsetMax = offMax;
		myRT.offsetMin = offMin;
		Debug.Log(gameObject.name + " Deselected");

Get the transform as RectTransform and cache the current offset values. Scale the offsets in Select and put them back to the cached value on Deselect.

You need to use custom script, where you detect when button in focus

According to API “Button” Class implements ISelectHandler which has method OnSelect, it should fire off each time when your button selected.
Once you capture this event you need to get selected button RectTransform component and scale from there