Beispiel #1
0
    public virtual Vector2 GetAxis(BaseController.eAxisId horizontalAxisId, BaseController.eAxisId verticalAxisId, float defaultValue = 0.0f)
    {
        Vector2 axis = Vector2.zero;

        axis.x = GetAxis(horizontalAxisId);
        axis.y = GetAxis(verticalAxisId);

        return(axis);
    }
Beispiel #2
0
 public void AddJoystickAxisMap(BaseController.eAxisId axisId, int inputKey)
 {
     if (!m_AxixMaps.ContainsKey(axisId))
     {
         m_AxixMaps.Add(axisId, string.Format(JOYSTICK_AXIS_KEY, inputKey));
     }
     else
     {
         m_AxixMaps[axisId] = string.Format(JOYSTICK_AXIS_KEY, inputKey);
     }
 }
Beispiel #3
0
 public void AddAxisMap(BaseController.eAxisId axisId, string inputKey)
 {
     if (!m_AxixMaps.ContainsKey(axisId))
     {
         m_AxixMaps.Add(axisId, inputKey);
     }
     else
     {
         m_AxixMaps[axisId] = inputKey;
     }
 }
Beispiel #4
0
    public virtual float GetAxis(BaseController.eAxisId axisId, float defaultValue = 0.0f)
    {
        string axisCode = GetAxisCode(axisId);

        if (!string.IsNullOrEmpty(axisCode))
        {
            return(Input.GetAxis(axisCode));
        }

        return(defaultValue);
    }
Beispiel #5
0
    protected string GetAxisCode(BaseController.eAxisId axisId)
    {
        string axisCode = "";

        if (m_AxixMaps.ContainsKey(axisId))
        {
            axisCode = m_AxixMaps[axisId];
            axisCode = axisCode.Replace("#", ((int)ControllerId).ToString());
        }

        return(axisCode);
    }