You can use the fill amount attribute of the uisprite component in the image control to control the effect of CD rotation in ngui.
In the middle skill, it indicates the image that requires cool-down skill; its sub-control label indicates the shortcut key "Y" in the lower right corner "; the child control sprite represents an image that overwrites it (in this example, an empty translucent image );
using UnityEngine;using System.Collections;public class CDCold : MonoBehaviour { private float coldTime=2; private bool isColding=false; private UISprite sprite; // Use this for initialization void Awake () { sprite = transform.Find ("Sprite").GetComponent<UISprite> (); } // Update is called once per frame void Update () { if (Input.GetKey (KeyCode.Y) && isColding == false) { isColding=true; sprite.fillAmount=1; } if (isColding) { sprite.fillAmount-=(1.0f/coldTime)*Time.deltaTime; if(sprite.fillAmount<=0.0f) { sprite.fillAmount=0; isColding=false; } } }}
CD cooling effect implementation