void IHandSelected.HandSelected(HandSelectedEventArgs eventArgs) { var curTime = _gameTiming.CurTime; var cool = TimeSpan.FromSeconds(CooldownTime * 0.5f); if (curTime < _cooldownEnd) { if (_cooldownEnd - curTime < cool) { _lastAttackTime = curTime; _cooldownEnd += cool; } else { return; } } else { _lastAttackTime = curTime; _cooldownEnd = curTime + cool; } RefreshItemCooldown(); }
public void HandSelected(HandSelectedEventArgs eventArgs) { var session = eventArgs.User?.GetComponent <BasicActorComponent>()?.playerSession; if (session == null) { return; } _instrumentPlayer = session.ConnectedClient; }