private void CheckReturnState() { if (useTimer >= attackSpeed) { useTimer = 0.0f; useState = PhysicalWeaponUseState.Default; hits.Clear(); if (OnEndPrimary != null) { OnEndPrimary(this, new EventArgs()); } } }
public void Primary() { if (!canUse) { return; } if (useState == PhysicalWeaponUseState.Default) { if (OnPrimary != null) { OnPrimary(this, new EventArgs()); } useState = PhysicalWeaponUseState.Attacking; } }
public void EndSecondary() { if (!canUse) { return; } if (useState == PhysicalWeaponUseState.Blocking) { if (OnEndSecondary != null) { OnEndSecondary(this, new EventArgs()); } useState = PhysicalWeaponUseState.Default; EffectManager manager = GetComponentInParent <EffectManager>(); if (manager != null && blockEffect != null) { manager.RemoveEffect(blockEffect); blockEffect = null; } } }
public void Secondary() { if (!canUse) { return; } if (useState == PhysicalWeaponUseState.Default) { if (OnSecondary != null) { OnSecondary(this, new EventArgs()); } useState = PhysicalWeaponUseState.Blocking; EffectManager manager = GetComponentInParent <EffectManager>(); if (manager != null) { blockEffect = new BlockEffect(minBlockValue, maxBlockValue); manager.AddEffect(blockEffect); } } }