Ejemplo n.º 1
0
 // All inputs require all four of these variables. This is intentional, and should not be overridden.
 public ActionPackage(Action <InputActionEventData> actionToCall, UpdateLoopType loop, InputActionEventType eventType, string nameForAction)
 {
     onActiveInput   = actionToCall;
     typeOfLoop      = loop;
     typeOfEvent     = eventType;
     inputActionName = nameForAction;
 }
Ejemplo n.º 2
0
    ///////////////////////////////////////////////////////////////////
    /// InputManager Implementation
    ///////////////////////////////////////////////////////////////////


    /// <summary>
    /// Add an input event delegate to the player. Use Rewired to handle this.. so great!
    /// </summary>
    /// <param name="inputDelegate"></param>
    /// <param name="updateType"></param>
    public void AddInputEventDelegate(Action <InputActionEventData> inputDelegate, UpdateLoopType updateType)
    {
        Debug.Assert(m_RewiredPlayer != null, "Rewired Player is null, cannot add input delegate!");

        if (m_RewiredPlayer != null)
        {
            m_RewiredPlayer.AddInputEventDelegate(inputDelegate, updateType);

            m_InputDelegateCache.Add(inputDelegate);
        }
    }
Ejemplo n.º 3
0
    ///////////////////////////////////////////////////////////////////
    /// InputManager Implementation
    ///////////////////////////////////////////////////////////////////


    /// <summary>
    /// Add an input event delegate to the player. Use Rewired to handle this.. so great!
    /// </summary>
    /// <param name="inputDelegate"></param>
    /// <param name="updateType"></param>
    public void AddInputEventDelegate(Action <InputActionEventData> inputDelegate, UpdateLoopType updateType)
    {
        Debug.Assert(m_RewiredPlayers.Count > 0 && m_InputDelegateCache != null, "No Rewired players found, cannot add input delegate!");

        if (m_InputDelegateCache != null)
        {
            for (int i = 0; i < m_RewiredPlayers.Count; i++)
            {
                m_RewiredPlayers[i].AddInputEventDelegate(inputDelegate, updateType);
            }

            m_InputDelegateCache.Add(inputDelegate);
        }
    }