using System; using System.Collections.Generic; using System.Text; namespace Thousandto.Code.Logic { /// /// 冻结Input消息的处理器 /// public class FreezeInputHandler { //冻结时间 private float _freezeTime = 0; //是否冻结 public bool IsFreezed { get { return _freezeTime > 0; } } //冻结Input的时间 public void FreezeInput(float time = float.MaxValue) { _freezeTime = time; } //检验是否冻结,true:表示没有冻结,false表示冻结 public bool Update(float deltaTime) { if (_freezeTime > 0) { _freezeTime -= deltaTime; } return _freezeTime <= 0; } } }