技能冷却UGUI5.1
来源:互联网 发布:傲剑坐骑数据 编辑:程序博客网 时间:2024/05/01 05:23
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class SkillItem : MonoBehaviour
{
public float coldTime = 2;
public KeyCode keycode;
private float timer = 0;
private Image filledImage;
private bool isStartTimer = false;
// Use this for initialization
void Start ()
{
filledImage = transform.Find("FilledImage").GetComponent<Image>();
Toggle toggle;
ToggleGroup group;
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(keycode))
{
isStartTimer = true;
}
if (isStartTimer)
{
timer += Time.deltaTime;
filledImage.fillAmount = (coldTime - timer)/coldTime;
if (timer >= coldTime)
{
filledImage.fillAmount = 0;
timer = 0;
isStartTimer = false;
}
}
}
public void OnClick()
{
isStartTimer = true;
}
}
using System.Collections;
using UnityEngine.UI;
public class SkillItem : MonoBehaviour
{
public float coldTime = 2;
public KeyCode keycode;
private float timer = 0;
private Image filledImage;
private bool isStartTimer = false;
// Use this for initialization
void Start ()
{
filledImage = transform.Find("FilledImage").GetComponent<Image>();
Toggle toggle;
ToggleGroup group;
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(keycode))
{
isStartTimer = true;
}
if (isStartTimer)
{
timer += Time.deltaTime;
filledImage.fillAmount = (coldTime - timer)/coldTime;
if (timer >= coldTime)
{
filledImage.fillAmount = 0;
timer = 0;
isStartTimer = false;
}
}
}
public void OnClick()
{
isStartTimer = true;
}
}
0 0
- 技能冷却UGUI5.1
- 技能冷却
- NGUI做技能冷却
- cocos2d-x 技能冷却
- ngui 做技能冷却
- 技能冷却效果-[Unity]
- 技能冷却图标实现
- NGUI实现技能冷却
- 制作技能冷却特效
- 技能冷却图标
- NGUI技能冷却
- CD技能冷却
- 技能冷却设置
- unity技能冷却
- 技能冷却效果
- 【UGUI】技能冷却
- cocos2d-x技能冷却效果
- cocos2d-x技能冷却效果
- android手机客户端上传文件,java servlet服务器端接收并保存到服务器
- keepalived工作原理和配置说明
- Bootstrap栅格布局的注意事项
- Java中BufferedReader和scanner的对比
- Nucleus PLUS系统架构和组件
- 技能冷却UGUI5.1
- Android开源测试框架学习
- 【OJ测试技巧】大量示例测试方法
- JSON基础
- JTAG与SWD的区别
- C#中Ilist与list的区别小结
- 嵌入式实时操作系统Nucleus PLUS综述
- 黄聪:如何使用CodeSmith批量生成代码(原创系列教程)
- Eclipse中SVN的安装及使用