Ejemplo n.º 1
0
        internal void Update(ulong updateTick, float deltaTime)
        {
            InputDevice       device                   = Device ?? FindActiveDevice();
            BindingSourceType lastInputType            = LastInputType;
            ulong             lastInputTypeChangedTick = LastInputTypeChangedTick;
            InputDeviceClass  lastDeviceClass          = LastDeviceClass;
            InputDeviceStyle  lastDeviceStyle          = LastDeviceStyle;
            int count = actions.Count;

            for (int i = 0; i < count; i++)
            {
                PlayerAction playerAction = actions[i];
                playerAction.Update(updateTick, deltaTime, device);
                if (playerAction.UpdateTick > UpdateTick)
                {
                    UpdateTick   = playerAction.UpdateTick;
                    activeDevice = playerAction.ActiveDevice;
                }
                if (playerAction.LastInputTypeChangedTick > lastInputTypeChangedTick)
                {
                    lastInputType            = playerAction.LastInputType;
                    lastInputTypeChangedTick = playerAction.LastInputTypeChangedTick;
                    lastDeviceClass          = playerAction.LastDeviceClass;
                    lastDeviceStyle          = playerAction.LastDeviceStyle;
                }
            }
            int count2 = oneAxisActions.Count;

            for (int j = 0; j < count2; j++)
            {
                oneAxisActions[j].Update(updateTick, deltaTime);
            }
            int count3 = twoAxisActions.Count;

            for (int k = 0; k < count3; k++)
            {
                twoAxisActions[k].Update(updateTick, deltaTime);
            }
            if (lastInputTypeChangedTick > LastInputTypeChangedTick)
            {
                bool flag = lastInputType != LastInputType;
                LastInputType            = lastInputType;
                LastInputTypeChangedTick = lastInputTypeChangedTick;
                LastDeviceClass          = lastDeviceClass;
                LastDeviceStyle          = lastDeviceStyle;
                if (this.OnLastInputTypeChanged != null && flag)
                {
                    this.OnLastInputTypeChanged(lastInputType);
                }
            }
        }