示例#1
0
 public static bool GetAnyPress(ViveRoleProperty role, ControllerButtonMask mask, bool usePrevState = false)
 {
     return(GetAnyPress(role.roleType, role.roleValue, mask, usePrevState));
 }
示例#2
0
 public static bool GetAllPressEx <TRole>(TRole role, ControllerButtonMask mask, bool usePrevState = false)
 {
     return(mask.GetAllPress(GetPressEx(role, usePrevState)));
 }
示例#3
0
 public static bool GetAllPress(HandRole role, ControllerButtonMask mask, bool usePrevState = false)
 {
     return(GetAllPressEx(role, mask, usePrevState));
 }
示例#4
0
 public static bool GetAllPress(Type roleType, int roleValue, ControllerButtonMask mask, bool usePrevState = false)
 {
     return(mask.GetAllPress(GetPressEx(roleType, roleValue, usePrevState)));
 }
        //public static bool GetAnyPressDown<TRole>(TRole role, ControllerButtonMask mask)
        //{
        //    var state = GetState(role);
        //    return !mask.GetAnyPress(state.PreviousButtonPressed) && mask.GetAnyPress(state.CurrentButtonPressed);
        //}

        //public static bool GetAnyPressUp<TRole>(TRole role, ControllerButtonMask mask)
        //{
        //    var state = GetState(role);
        //    return mask.GetAllPress(state.PreviousButtonPressed) && !mask.GetAllPress(state.CurrentButtonPressed);
        //}

        public static bool GetAllPress <TRole>(TRole role, ControllerButtonMask mask, bool usePrevState = false)
        {
            return(mask.GetAllPress(usePrevState ? GetState(role).PreviousButtonPressed : GetState(role).CurrentButtonPressed));
        }
        //public static bool GetAnyPressDown(Type roleType, int roleValue, ControllerButtonMask mask)
        //{
        //    var state = GetState(roleType, roleValue);
        //    return !mask.GetAnyPress(state.PreviousButtonPressed) && mask.GetAnyPress(state.CurrentButtonPressed);
        //}

        //public static bool GetAnyPressUp(Type roleType, int roleValue, ControllerButtonMask mask)
        //{
        //    var state = GetState(roleType, roleValue);
        //    return mask.GetAllPress(state.PreviousButtonPressed) && !mask.GetAllPress(state.CurrentButtonPressed);
        //}

        public static bool GetAllPress(Type roleType, int roleValue, ControllerButtonMask mask, bool usePrevState = false)
        {
            return(mask.GetAllPress(usePrevState ? GetState(roleType, roleValue).PreviousButtonPressed : GetState(roleType, roleValue).CurrentButtonPressed));
        }