using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class SkillItem : MonoBehaviour { //冷却时间 public float coldTime = 2.0f; //定时器 private float timer = 0f; //前面的一张填充图片 private Image filedImage; /…
using UnityEngine; using System.Collections; using UnityEngine.UI; public class HealthController : MonoBehaviour { //当前对象是血条还是蓝条 public bool isHealth = false; //虚拟轴,横轴,纵轴 private float hor,ver; //血条的最大宽度 ; //蓝条的最大宽度 ; //当前的虚拟轴 private float currentAx…
using System.Collections; using System.Collections.Generic; using UnityEngine; public class CDScripts : MonoBehaviour { ; //技能的冷却速度 public bool cd_isCan = false; //是否可以释放技能的标志位 private UISprite cd_sprite; private void Awake() { cd_sprite = GameObject…
UGUI的Button组件只有OnClick事件的监听,要实现长按功能,要监听按下事件和抬起事件,所以要使用到EventTrigger组件中的OnPointerDown和OnPointerUp来监听. 为了方便,把EventTrigger中的事件监听都封装起来,我是使用了雨松MOMO写的EventTriggerListener,用起来很方便,地址:http://www.xuanyusong.com/archives/3325 代码: using UnityEngine; using System…