static public int set_OnUpdate(IntPtr l) { try { CooldownUpdate self = (CooldownUpdate)checkSelf(l); System.Action v; int op = LuaDelegation.checkDelegate(l, 2, out v); if (op == 0) { self.OnUpdate = v; } else if (op == 1) { self.OnUpdate += v; } else if (op == 2) { self.OnUpdate -= v; } pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
protected virtual void Update() { // is the item on cooldown? if (_isOnCooldown) { // update remaining cooldown _remainingCooldown -= Time.deltaTime; CooldownUpdate?.Invoke(_remainingCooldown, _model.CooldownTime); // cooldown done? if (_remainingCooldown <= 0) { _isOnCooldown = false; CooldownStopped?.Invoke(); } } // is the item being actively used? if (_isActive) { // update time left _remainingDuration -= Time.deltaTime; // item duration done? if (_remainingDuration <= 0) { FinishItemUse(); } } }
static public int get_isCooldown(IntPtr l) { try { CooldownUpdate self = (CooldownUpdate)checkSelf(l); pushValue(l, true); pushValue(l, self.isCooldown); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int SetEndTime(IntPtr l) { try { CooldownUpdate self = (CooldownUpdate)checkSelf(l); System.UInt32 a1; checkType(l, 2, out a1); self.SetEndTime(a1); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_cooldownSound(IntPtr l) { try { CooldownUpdate self = (CooldownUpdate)checkSelf(l); System.UInt32 v; checkType(l, 2, out v); self.cooldownSound = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_isTicket(IntPtr l) { try { CooldownUpdate self = (CooldownUpdate)checkSelf(l); System.Boolean v; checkType(l, 2, out v); self.isTicket = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }