예제 #1
0
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //	* New Method: Update Released Buttons
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    private void UpdateReleasedButtons()
    {
        foreach (ActiveInputButtons previousFrameButton in m_lPreviousInput)
        {
            if (m_lCurrentInput.GetExisting(previousFrameButton.buttonObject) == null)
            {
                Button_Base[] releasedButtons = previousFrameButton.buttonObject.GetComponents <Button_Base>();
                for (int i = 0; i < releasedButtons.Length; ++i)
                {
                    if (releasedButtons[i].enabled)
                    {
                        if (releasedButtons[i].KeepPressedEvenWithNoContact)
                        {
#if UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX
                            if (Input.GetMouseButton(previousFrameButton.touchIDs.First.Value))
#else
                            if (Input.touchCount > previousFrameButton.touchIDs.First.Value)
#endif
                            {
                                previousFrameButton.inputTriggered = false;
                                m_lCurrentInput.AddLast(previousFrameButton);
                            }
                            else
                            {
                                releasedButtons[i].PushInputSystem(null, ButtonState.RELEASED);
                            }
                        }
                        else
                        {
                            releasedButtons[i].PushInputSystem(null, ButtonState.RELEASED);
                        }
                    }
                }
            }
        }
    }