【Unity】NGUI实现技能冷却脚本
来源:互联网 发布:vb源码下载 编辑:程序博客网 时间:2024/04/30 11:48
using UnityEngine;
using System.Collections;
public class Skill_cold : MonoBehaviour {
public UISprite cold_icon;
public float coldTime = 3f;
private bool startCold = false;
//Use this for initialization
void Start()
{
}
//Update is called one per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.A) && startCold==false )
{
cold_icon.fillAmount = 1;
startCold = true;
}
Colding();
}
void Colding() //正在冷却方法
{
if (startCold)
{
//速度乘以时间间隔
cold_icon.fillAmount -= (1f / coldTime) * Time.deltaTime;
if (cold_icon.fillAmount <= 0.05f) //当小于一定值时,判定已经冷却完毕
{
cold_icon.fillAmount = 0;
startCold = false;
}
}
}
using System.Collections;
public class Skill_cold : MonoBehaviour {
public UISprite cold_icon;
public float coldTime = 3f;
private bool startCold = false;
//Use this for initialization
void Start()
{
}
//Update is called one per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.A) && startCold==false )
{
cold_icon.fillAmount = 1;
startCold = true;
}
Colding();
}
void Colding() //正在冷却方法
{
if (startCold)
{
//速度乘以时间间隔
cold_icon.fillAmount -= (1f / coldTime) * Time.deltaTime;
if (cold_icon.fillAmount <= 0.05f) //当小于一定值时,判定已经冷却完毕
{
cold_icon.fillAmount = 0;
startCold = false;
}
}
}
}
技能遮罩的图片类型如上图所示Type设为Filled
0 0
- 【Unity】NGUI实现技能冷却脚本
- Unity NGUI实现技能冷却
- Unity插件NGUI实现技能冷却效果
- NGUI实现技能冷却
- Unity手游开发--NGUI实现冷却技能(CD)功能
- NGUI做技能冷却
- ngui 做技能冷却
- NGUI技能冷却
- unity视频笔记——ngui-技能冷却,注册,聊天
- Unity 3D 技能释放的脚本 技能冷却时间
- 技能冷却效果-[Unity]
- unity技能冷却
- NGUI制作技能冷却效果
- 技能冷却图标实现
- Unity制作技能冷却效果
- NGUI技能冷却CD特效制作
- NGUI(二)技能冷却页面
- Unity3d之NGUI制作技能冷却
- Ubuntu 12.04下关闭图形界面的相关问题
- 表分区
- AngularJS 中的 Promise 和 设计模式
- TCP/IP 详解卷一 - 第2章 链路层
- 雷军不是个好程序员
- 【Unity】NGUI实现技能冷却脚本
- LeetCode125——Valid Palindrome
- Hadoop报错信息:Job not successful. Error: # of failed Map Tasks exceeded allowed limit. FailedCount: 4.
- The Open Source Interconnection (OSI) Model
- ios去掉字符串中的html标签的方法
- 【设计模式】-模板方法模式(Template)
- Unity 通过脚本修改源资源
- postgres函数
- winows运行时应用生命周期