12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using UnityEngine;
- using System.Collections;
- public class TestButtonClickSpan : MonoBehaviour {
- float spanTime = 0;
- bool isStart = false;
- /// <summary>
- ///
- /// </summary>
- public GameObject mBtn = null;
- // Use this for initialization
- void Start () {
- EventTriggerListener.Get(this.mBtn).onClick = OnHandle;
- }
- int i = 0;
- /// <summary>
- /// 释放
- /// </summary>
- /// <param name="obj"></param>
- private void OnHandle(GameObject obj)
- {
- if (spanTime > 5)
- { return; }
- isStart = true;
- LogHelper.LogError(i++);
- }
- // Update is called once per frame
- void Update () {
- if (spanTime > 5)
- { return; }
- spanTime += Time.deltaTime;
- }
- }
|