Beispiel #1
0
    protected void OnStay(Collider _col)
    {
        if (!PassesValidation(_col))
        {
            return;
        }

        if (onStayOption == OnStayOptionType.Constant)
        {
            ActivateEvents(_col);
        }
        else if (onStayOption == OnStayOptionType.Repeat)
        {
            repeatTimer += Time.deltaTime;
            if (repeatTimer > repeatDelay)
            {
                ActivateEvents(_col);
                repeatTimer = 0;
            }
        }
        else if (onStayOption == OnStayOptionType.OnInput)
        {
            if (input.GetInput())
            {
                ActivateEvents(_col);
            }
        }
        else if (onStayOption == OnStayOptionType.OnInputDown)
        {
            if (input.GetInputDown())
            {
                ActivateEvents(_col);
            }
        }
        else if (onStayOption == OnStayOptionType.OnInputUp)
        {
            if (input.GetInputUp())
            {
                ActivateEvents(_col);
            }
        }
    }
Beispiel #2
0
    void GetInputs()
    {
        if (mm)
        {
            if (mm.IsPaused)
            {
                return;
            }
        }

        if (inputType == UnitEquip.InputType.None)
        {
            return;
        }

        if (useButton.GetInputDown())
        {
            Use();
        }
        else if (Data.repeatUntilStopped && useButton.GetInputUp())
        {
            Stop();
        }
    }
Beispiel #3
0
    void GetInputs()
    {
        //loop through all quick commands
        if (curItems != null)
        {
            if (seperateUseButtonsForItems)
            {
                for (int i = 0; i < useButtons.Length; i++)
                {
                    if (useButtons[i].GetInputDown())
                    {
                        SetCurItem(i);
                        if (curItem)
                        {
                            curItem.UseItem();
                        }
                    }
                    else if (useButtons[i].GetInputUp())
                    {
                        SetCurItem(i);
                        if (curItem)
                        {
                            curItem.StopUseItem();
                        }
                    }
                }
            }

            for (int i = 0; i < curItems.Length; i++)
            {
                if (Input.GetButtonDown(quickMenuButtons[i].stringValue))
                {
                    SetCurItem(i);
                }
            }

            if (enableToggleSwitch)
            {
                if (Input.GetButtonDown(toggleForwardsButton.stringValue))
                {
                    SwitchToNextItemForward();
                }
                if (Input.GetButtonDown(toggleBackwardsButton.stringValue))
                {
                    SwitchToNextItemBackward();
                }
            }
        }

        if (Input.GetButtonDown(equipButton.stringValue) && !autoEquipItems)
        {
            EquipCurItem(!equipped);
        }

        if (equipped && !seperateUseButtonsForItems)
        {
            if (useButton.GetInputDown())
            {
                curItem.UseItem();
            }
            else if (useButton.GetInputUp())
            {
                curItem.StopUseItem();
            }

            if (dropButton.GetInputDown())
            {
                DropCurrentItem();
            }
        }
    }