Beispiel #1
0
    private void CheckReturnState()
    {
        if (useTimer >= attackSpeed)
        {
            useTimer = 0.0f;
            useState = PhysicalWeaponUseState.Default;
            hits.Clear();

            if (OnEndPrimary != null)
            {
                OnEndPrimary(this, new EventArgs());
            }
        }
    }
Beispiel #2
0
    public void Primary()
    {
        if (!canUse)
        {
            return;
        }

        if (useState == PhysicalWeaponUseState.Default)
        {
            if (OnPrimary != null)
            {
                OnPrimary(this, new EventArgs());
            }

            useState = PhysicalWeaponUseState.Attacking;
        }
    }
Beispiel #3
0
    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;
            }
        }
    }
Beispiel #4
0
    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);
            }
        }
    }