NGUI技能冷却CD特效制作
来源:互联网 发布:java工程师工作职责 编辑:程序博客网 时间:2024/05/16 12:48
其实蛮简单的今天紫龙感觉萌萌哒就详详细细地记录一下把:
首先在制作一个sprite命名为skill加一个背景图片,然后再建立一个sprite,选择一个可以挡住skill的背景的图片,然后选择Filled属性(如下图)。然后在Sprite下面建立一个Label用来表示技能的按键快捷键,本例用的是R键。。。如下图
因为sprite的图片挡住了skill的图片,所以给sprite的Alpha值调整到半透明,调整在color里面的属性如图(图的左边已经看到了效果);在color的上面有个 Fill Amount属性,这个属性就是负责cd效果的,只要用脚本去调整参数就可以了。
调整的脚本如下
using UnityEngine;using System.Collections;public class skill_cd : MonoBehaviour { public int cdtime=2; private UISprite sprite; private bool iscolding=false ;//是否在冷却 public // Use this for initializationvoid Awake () { sprite =transform .Find ("Sprite").GetComponent <UISprite >();}// Update is called once per framevoid Update () {if (Input.GetKeyDown (KeyCode.R) &&iscolding ==false )//按键R { //释放技能创建粒子系统显示技能特效 //ui上显示cd效果 sprite .fillAmount =1; iscolding =true; }if (iscolding ){ sprite.fillAmount -= (1f / cdtime) * Time.deltaTime; if (sprite.fillAmount <= 0.05) { iscolding = false; sprite.fillAmount = 0; } }}}
最后只要把脚本拖给Skill然后运行按键盘R键就可以看到效果了。。。如图:(萌萌哒有木有)
0 1
- NGUI技能冷却CD特效制作
- 制作技能冷却特效
- NGUI制作技能冷却效果
- NGUI研究之制作转圈的技能CD特效
- Unity3d之NGUI制作技能冷却
- CD技能冷却
- NGUI研究院之制作转圈的技能CD特效(八)
- NGUI研究院之制作转圈的技能CD特效(八)
- NGUI做技能冷却
- ngui 做技能冷却
- NGUI实现技能冷却
- NGUI技能冷却
- Unity NGUI实现技能冷却
- Unity手游开发--NGUI实现冷却技能(CD)功能
- ProgressTimer制作技能冷却效果
- Unity制作技能冷却效果
- unity3d技能冷却cd(第一篇)
- unity3d技能冷却cd(最后一篇)
- 关于opencv2.4.9配置vS2010(win7 32)
- makefile.new(7117) : error U1087: cannot have : and :: dependents for same target
- sql 创建异库链接
- Decode Ways
- CoffeeScript的缩进
- NGUI技能冷却CD特效制作
- Linux 命令整理 —— 基本操作
- 对于面向接口编程的理解
- ScheduledExecutorService 多线程类简单使用
- MRC注意事项
- ContentProvider与ContentResolver
- Choosing an OpenGL API Version(选择OpenGL API版本)
- 开发模式之策略模式
- 关于MFC中任意对象的拖拽功能的实现(COleDataSource, COleDropTarget)