void Start () { body = GetComponent<Rigidbody>(); forwardsVector = Vector3.forward; sphereCollider = GetComponent<SphereCollider>(); input = PlayerInput.GetInput((int)playerNumber); }
public void Apply_UnknownTypeThatCannotBeConstructed_ShouldThrowException() { // Arrange & Act Action action = () => InputMapper.Apply(_interopMock.Object, DataHandle, new { UnknownType = 1.0f }); // Assert action.Should().Throw <InvalidOperationException>() .WithMessage("No matching field constructor found"); }
void Start() { controllerLayoutIndex = InputMapper.PlayerNumToControllerLayoutIndex(playerNum); // Only first player layout (keyboard + mouse) is allowed to use mouse if (controllerLayoutIndex != 0) { supportMouse = false; } }
private void Update() { InputMapper.GetMovement(); if (!lastControllerValue && InputMapper.usingController && selectedByDefault) { GetComponent <Button>().Select(); } lastControllerValue = InputMapper.usingController; }
void Update() { if (EventSystem.current.currentSelectedGameObject == gameObject) { if (InputMapper.InteractionButton()) { button.onClick.Invoke(); } } }
void Start() { m_characterController = GetComponent <CharacterController>(); m_inputMapper = GetComponent <InputMapper>(); // from the SUVAT equation: // v^2 = u^2 + 2as where u = 0 // thanks chillwell. m_jumpForce = Mathf.Sqrt(jumpHeight * Physics.gravity.y * -2.0f); }
private void Start() { _inputMapper = new InputMapper(); _inputConfig = Resources.Load <InputConfig>("InputConfig"); _inputContextDic.Add(_inputConfig.normalHumanContext.inputContextType, new InputContext(_inputConfig.normalHumanContext)); _inputContextDic.Add(_inputConfig.priorityConfig.inputContextType, new InputContext(_inputConfig.priorityConfig)); currentInputContextType = EInputContextType.NormalHumanPlayer; AddInputContext(currentInputContextType); InitVirtualKeyAccessableDic(); }
protected GameBase(Options options, IGamePlatformFactory gamePlatformFactory, IGraphicsFactory graphicsFactory, IInputFactory inputFactory) { _options = options; _gamePlatformFactory = gamePlatformFactory; GraphicsFactory = graphicsFactory; _inputFactory = inputFactory; _inputMapper = new InputMapper(_inputFactory); _gameLoop = _gamePlatformFactory.CreateGameLoop(); }
public void Apply_NullString_ShouldNotMapString() { RfcErrorInfo errorInfo; InputMapper.Apply(_interopMock.Object, DataHandle, new { SomeString = (string)null }); _interopMock.Verify( x => x.SetString(It.IsAny <IntPtr>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <uint>(), out errorInfo), Times.Never); }
public void Apply_Double_ShouldMapAsFloat() { // Arrange RfcErrorInfo errorInfo; // Act InputMapper.Apply(_interopMock.Object, DataHandle, new { SomeDouble = 1234.5d }); // Assert _interopMock.Verify(x => x.SetFloat(DataHandle, "SOMEDOUBLE", 1234.5d, out errorInfo), Times.Once); }
public void Apply_Int_ShouldMapAsInt() { // Arrange RfcErrorInfo errorInfo; // Act InputMapper.Apply(_interopMock.Object, DataHandle, new { SomeInt = 555 }); // Assert _interopMock.Verify(x => x.SetInt(DataHandle, "SOMEINT", 555, out errorInfo), Times.Once); }
internal bool Refresh(InputMapper mapper) { var mappingCollection = mapper.GetMapping(inputType); if (mappingCollection != null) { double newValue = mappingCollection.GetValue(inputType); return(RefreshValue(newValue)); } return(false); }
public void Apply_String_ShouldMapAsString() { // Arrange RfcErrorInfo errorInfo; // Act InputMapper.Apply(_interopMock.Object, DataHandle, new { SomeString = "Hello" }); // Assert _interopMock.Verify(x => x.SetString(DataHandle, "SOMESTRING", "Hello", 5, out errorInfo)); }
public void Apply_CharArray_ShouldMapAsCharArray() { // Arrange RfcErrorInfo errorInfo; // Act InputMapper.Apply(_interopMock.Object, DataHandle, new { SomeCharArray = new char[] { '0', '1', '2' } }); // Assert _interopMock.Verify(x => x.SetChars(DataHandle, "SOMECHARARRAY", new char[] { '0', '1', '2' }, 3, out errorInfo)); }
public void Apply_ByteArray_ShouldMapAsByteArray() { // Arrange RfcErrorInfo errorInfo; // Act InputMapper.Apply(_interopMock.Object, DataHandle, new { SomeByteArray = new byte[] { 0, 1, 2 } }); // Assert _interopMock.Verify(x => x.SetBytes(DataHandle, "SOMEBYTEARRAY", new byte[] { 0, 1, 2 }, 3, out errorInfo)); }
public void Apply_Decimal_ShouldMapAsFormattedString() { // Arrange RfcErrorInfo errorInfo; // Act InputMapper.Apply(_interopMock.Object, DataHandle, new { SomeDecimal = 123.4M }); // Assert _interopMock.Verify(x => x.SetString(DataHandle, "SOMEDECIMAL", "123.4", 5, out errorInfo), Times.Once); }
// Token: 0x06001847 RID: 6215 RVA: 0x000739BC File Offset: 0x00071BBC private void RemoveInputMapper(InputMapper inputMapper) { inputMapper.ConflictFoundEvent -= this.InputMapperOnConflictFoundEvent; inputMapper.CanceledEvent -= this.InputMapperOnCanceledEvent; inputMapper.ErrorEvent -= this.InputMapperOnErrorEvent; inputMapper.InputMappedEvent -= this.InputMapperOnInputMappedEvent; inputMapper.StartedEvent -= this.InputMapperOnStartedEvent; inputMapper.StoppedEvent -= this.InputMapperOnStoppedEvent; inputMapper.TimedOutEvent -= this.InputMapperOnTimedOutEvent; this.inputMappers.Remove(inputMapper); }
private void Update() { if (continueTimer > 0.2f && InputMapper.InteractionButton()) { callback?.Invoke(0); } else if (continueTimer <= 0.2f) { continueTimer += Time.unscaledDeltaTime; } }
public void MapperTest(double min, double max, double value, double mappedValue) { var mapper = new InputMapper { MinValue = min, MaxValue = max, }; double result = mapper.GetValue(value); Assert.AreEqual(mappedValue, result); }
private void Awake() { if (instance != null && instance != this) { Destroy(this); } else { instance = this; } }
private void Awake() { if (Instance) { GameObject.Destroy(this.gameObject); } else { Instance = this; } }
public void Apply_Long_ShouldMapAsInt8() { // Arrange RfcErrorInfo errorInfo; // Act InputMapper.Apply(_interopMock.Object, DataHandle, new { SomeLong = 123L }); // Assert _interopMock.Verify(x => x.SetInt8(DataHandle, "SOMELONG", 123L, out errorInfo), Times.Once); }
private void Awake() { inputMapper = GetComponent <InputMapper>(); foreach (InputSystem system in inputSystems) { inputMapper.AddToWatch(system); } InputSystem = inputMapper; }
public void Apply_Array_ShouldMapAsTable() { RfcErrorInfo errorInfo; var model = new { SomeArray = Fixture.CreateMany <ArrayElement>(2).ToArray() }; InputMapper.Apply(_interopMock.Object, DataHandle, model); IntPtr tableHandle; _interopMock.Verify(x => x.GetTable(DataHandle, "SOMEARRAY", out tableHandle, out errorInfo), Times.Once); }
public void Apply_ModelWithCustomNameAttribute_ShouldUseCustomSapNameInsteadOfPropertyName() { RfcErrorInfo errorInfo; var model = new CustomNameAttributeModel { Value = 123 }; InputMapper.Apply(_interopMock.Object, DataHandle, model); _interopMock.Verify(x => x.SetInt(DataHandle, "CUSTOM_IN_VAL", 123, out errorInfo), Times.Once); }
void Awake() { _qualtyNames = QualitySettings.names; _inputMapper = InputMapper.Default; _inputMapper.options.timeout = 5; _inputMapper.options.ignoreMouseXAxis = true; _inputMapper.options.ignoreMouseYAxis = true; ReInput.userDataStore.Load(); _version.text = Game.Version.ToString("F2"); //_partyManagement.OnWindowClose += CloseClassMenu; //_partyManagement.OnWindowConfirm += StartNewGame; }
// Start is called before the first frame update void Start() { inputMapper = GetComponent <InputMapper>(); //inputMapper.AddMapping(Action.Test, KeyCode.A); //Debug.Log("Added mapping for Test"); //inputMapper.AddMapping(Action.MoveLeft, KeyCode.S); //Debug.Log("Added mapping for MoveLeft"); //inputMapper.RemoveMapping(Action.Test); //Debug.Log("Removed mapping for Test"); }
public void Apply_ModelWithSapIgnoreAttribute_ShouldIgnorePropertiesWithIgnoreAttribute() { RfcErrorInfo errorInfo; var model = new SapIgnoreAttributeModel { Value = 123, IgnoredProperty = 234 }; InputMapper.Apply(_interopMock.Object, DataHandle, model); _interopMock.Verify(x => x.SetInt(DataHandle, "VALUE", 123, out errorInfo), Times.Once); _interopMock.Verify(x => x.SetInt(DataHandle, "IGNOREDPROPERTY", 234, out errorInfo), Times.Never); }
public override void Apply(IRfcInterop interop, IntPtr dataHandle) { RfcResultCodes resultCode = interop.GetStructure( dataHandle: dataHandle, name: Name, structHandle: out IntPtr structHandle, out RfcErrorInfo errorInfo); resultCode.ThrowOnError(errorInfo); InputMapper.Apply(interop, structHandle, Value); }
private void Update() { if (InputMapper.DropButton()) { for (int i = 0; i < buttons.Count; i++) { if (buttons[i].gameObject == EventSystem.current.currentSelectedGameObject) { container.DropItem(i); } } } }
public void Apply_NullableDateTime_HasValue_ShouldMapAsDate() { RfcErrorInfo errorInfo; DateTime? date = new DateTime(2020, 4, 1); InputMapper.Apply(_interopMock.Object, DataHandle, new { SomeDate = date }); _interopMock.Verify(x => x.SetDate( DataHandle, "SOMEDATE", It.Is <char[]>(y => y.SequenceEqual("20200401")), out errorInfo)); }
public InputControlSetup() { Mapper = new InputMapper(); Mapper.AddInputBindProvider(typeof(KeyInputBindProvider), new KeyInputBindProvider()); Mapper.AddInputBindProvider(typeof(PadInputBindProvider), new PadInputBindProvider()); }
public InputManager(Microsoft.Xna.Framework.Game game) : base(game) { stateProviders = new Dictionary<Type, IInputStateProvider>(); Mapper = new InputMapper(); }