public BallModel(Vector3 position, IInputSystem inputSystem) { _startPosition = position; _inputSystem = inputSystem; Reset(); }
/// <summary> /// This Gets the Current Input System that is being used... Unity's, CrossPlatform or Rewired /// </summary> public static IInputSystem GetInputSystem(string PlayerID = "") { IInputSystem Input_System = null; #if !CROSS_PLATFORM_INPUT Input_System = new DefaultInput(); //Set it as default the Unit Input System #else Input_System = new CrossPlatform(); //Set the Input System to the UNITY STANDARD ASSET CROSS PLATFORM #endif #if REWIRED Rewired.Player player = Rewired.ReInput.players.GetPlayer(PlayerID); if (player != null) { Input_System = new RewiredInput(player); } else { Debug.LogError("NO REWIRED PLAYER WITH THE ID:" + PlayerID + " was found"); } #endif #if OOTII_EI Input_System = new EasyInput(); #endif return(Input_System); }
private void Construct( ICameraSystem cameraSystem, IInputSystem inputSystem) { this.inputSystem = inputSystem; this.cameraSystem = cameraSystem; }
protected void Awake() { Cam = GetComponentInChildren <Camera>().transform; Pivot = Cam.parent; if (manager) { manager.SetCamera(this); } if (startState) { SetState(startState); } Cursor.lockState = m_LockCursor ? CursorLockMode.Locked : CursorLockMode.None; // Lock or unlock the cursor. Cursor.visible = !m_LockCursor; m_PivotEulers = Pivot.rotation.eulerAngles; m_PivotTargetRot = Pivot.transform.localRotation; m_TransformTargetRot = transform.localRotation; inputSystem = DefaultInput.GetInputSystem(PlayerID); Horizontal.InputSystem = Vertical.InputSystem = inputSystem; //Update the Input System on the Axis }
/// <summary> /// Initializes the specified graphic system. /// </summary> /// <param name="graphicSystem">The graphic system.</param> /// <param name="physicSystem">The physic system.</param> /// <param name="textSystem">The text system.</param> /// <param name="inputSystem">The input system.</param> /// <param name="exitAction">The exit action.</param> public virtual void Initialize( IGraphicSystem graphicSystem, IPhysicSystem physicSystem, ITextSystem textSystem, IInputSystem inputSystem, Action exitAction) { Components = new List <IComponent>(); _componentsToRemove = new List <IComponent>(); _updatables = new List <IUpdatable>(); _drawables = new List <IDrawable>(); _time = new Time(); _pendingSceneToOpen = new NullScene(this); graphicSystem.Initialize(); textSystem.Initialize(); _drawContext = new DrawContext(graphicSystem, textSystem); GraphicSystem = graphicSystem; Bounds = Bounds == Rectangle.Zero ? graphicSystem.Bounds : Bounds; PhysicSystem = physicSystem; LogSystem = new NullLogSystem(); FontSystem = textSystem; InputSystem = inputSystem; this._exitAction = exitAction; }
private void ResetControl(IInputSystem inputSystem) { inputSystem.OnUp -= OnUp; inputSystem.OnDown -= OnDown; inputSystem.OnRight -= OnRight; inputSystem.OnLeft -= OnLeft; inputSystem.OnSpace -= OnFire; }
private void SetupControl(IInputSystem inputSystem) { inputSystem.OnUp += OnUp; inputSystem.OnDown += OnDown; inputSystem.OnRight += OnRight; inputSystem.OnLeft += OnLeft; inputSystem.OnSpace += OnFire; }
public void Init(IInputSystem input, IPlayerCamera camera) { Debug.Log($"{this} Init"); _inputSystem = input; _playerCamera = camera; SubscribeToEvents(); }
public InputAxis(string name, string InputValue, bool active, bool raw) { this.active = active; this.raw = raw; input = InputValue; this.name = name; inputSystem = new DefaultInput(); }
public Program(IFileSystem fileSystem, IInputSystem inputSystem, IBlockCompressor blockCompressor) { AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionTrapper; _fileSystem = fileSystem; _inputSystem = inputSystem; _blockCompressor = blockCompressor; }
public ImGuiRenderable(IInputSystem inputSystem, int width, int height, ILogger logger, EngineClient client) { _inputSystem = inputSystem; _width = width; _height = height; ImGuiInterface = new ImGuiInterface(logger, client); }
public InputRow(KeyCode k) { active.Value = true; type = InputType.Key; key = k; GetPressed = InputButton.Down; inputSystem = new DefaultInput(); }
public InputAxis(string value) { active = true; raw = false; input = value; name = "NewAxis"; inputSystem = new DefaultInput(); }
public InputAxis(string InputValue, bool active, bool isRaw) { this.active = active; this.raw = isRaw; input = InputValue; name = "NewAxis"; inputSystem = new DefaultInput(); }
public Game(GameConfiguration configuration) { this.configuration = configuration; inputSystem = configuration.InputSystem; grid = new SquareGrid(configuration.GridSideLength); timer = new Timer(configuration.UpdateIntervalMs); gameState = new GameState(); }
public override void Start() { _inputs = RegsiterActions(); InputManager.Instance.RegisterActions(_inputs); Body = GetComponent <Rigidbody>(); base.Start(); }
public InputAxis() { active = true; raw = true; input = "Value"; name = "NewAxis"; inputSystem = new DefaultInput(); }
public Scene(IInputSystem inputSystem, ICommandContext commandContext, GraphicsDevice gd, int viewWidth, int viewHeight) { Camera = new Camera(inputSystem, gd, viewWidth, viewHeight); _updateables.Add(Camera); if (commandContext == null) { throw new ArgumentNullException(nameof(commandContext)); } //TODO: might need to move these somewhere else //TODO: archived, but circular dependency on engine helpers makes it impossible for now _mainGamma = commandContext.RegisterVariable( new VariableInfo("mat_gamma") .WithValue(2.5f) .WithHelpInfo("The main gamma value to use for gamma correction") .WithMinMaxFilter(1.8f, 3.0f) .WithChangeHandler((ref VariableChangeEvent _) => _lightingSettingChanged = true)); _textureGamma = commandContext.RegisterVariable( new VariableInfo("mat_texgamma") .WithValue(2.0f) .WithHelpInfo("The texture gamma value to use for gamma correction") .WithMinMaxFilter(1.8f, null) .WithChangeHandler((ref VariableChangeEvent _) => _lightingSettingChanged = true)); _lightingGamma = commandContext.RegisterVariable( new VariableInfo("mat_lightgamma") .WithValue(2.5f) .WithHelpInfo("The lighting gamma value to use for gamma correction") .WithMinMaxFilter(1.8f, null) .WithChangeHandler((ref VariableChangeEvent _) => _lightingSettingChanged = true)); //TODO: archived _brightness = commandContext.RegisterVariable( new VariableInfo("mat_brightness") .WithValue(0.0f) .WithHelpInfo("The lighting brightness multiplier. Set to 0 to disable") .WithMinMaxFilter(0.0f, 2.0f) .WithChangeHandler((ref VariableChangeEvent _) => _lightingSettingChanged = true)); //TODO: archived _overbright = commandContext.RegisterVariable( new VariableInfo("mat_overbright") .WithValue(true) .WithHelpInfo("Enable or disable overbright lighting") .WithBooleanFilter() .WithChangeHandler((ref VariableChangeEvent _) => _lightingSettingChanged = true)); //TODO: mark as cheat cvar //TODO: needs to be an integer with settings 0, 1, 2 Fullbright = commandContext.RegisterVariable( new VariableInfo("mat_fullbright") .WithValue(false) .WithHelpInfo("Enable or disable full brightness (debug)") .WithBooleanFilter() .WithChangeHandler((ref VariableChangeEvent _) => _lightingSettingChanged = true)); }
public static IInputSystem GetInputSystem() { if (instance == null) { instance = CreateInstance(); } return(instance); }
public PlayerModel(Vector3 position, Vector3 direction, BoundsWithRotation movementArea, IInputSystem inputSystem) { Direction = direction; _startPosition = position; _inputSystem = inputSystem; _movementArea = movementArea; Reset(); }
/// <summary> /// Runs the action if specified key is down in the current frame. /// </summary> /// <returns>The input system.</returns> /// <param name="input">The input system.</param> /// <param name="key">The key.</param> /// <param name="action">The action.</param> public static IInputSystem IsKeyDown(this IInputSystem input, Keys key, Action action) { if (input.IsKeyDown(key)) { action(); } return(input); }
public InputRow(string unityInput, KeyCode k, InputButton pressed) { active.Value = true; type = InputType.Key; key = k; input = unityInput; GetPressed = InputButton.Down; inputSystem = new DefaultInput(); }
public InputRow(string input, KeyCode key) { active.Value = true; type = InputType.Key; this.key = key; this.input = input; GetPressed = InputButton.Down; inputSystem = new DefaultInput(); }
public Camera(IInputSystem inputSystem, GraphicsDevice gd, float width, float height) { _inputSystem = inputSystem; _gd = gd; _useReverseDepth = gd.IsDepthRangeZeroToOne; _windowWidth = width; _windowHeight = height; UpdatePerspectiveMatrix(); UpdateViewMatrix(); }
public InputRow() { active.Value = true; name = "InputName"; type = InputType.Input; input = "Value"; key = KeyCode.A; GetPressed = InputButton.Press; inputSystem = new DefaultInput(); }
public InputRow(bool active, string name, string unityInput, KeyCode k, InputButton pressed, InputType itype) { this.name = name; this.active.Value = active; type = itype; key = k; input = unityInput; GetPressed = pressed; inputSystem = new DefaultInput(); }
public void SetUp() { _animationSystem = Substitute.For <IAnimationSystem>(); _audioSystem = Substitute.For <IAudioSystem>(); _behaviorSystem = Substitute.For <IBehaviorSystem>(); _entityDestructionSystem = Substitute.For <IEntityDestructionSystem>(); _inputSystem = Substitute.For <IInputSystem>(); _physicsSystem = Substitute.For <IPhysicsSystem>(); _renderingSystem = Substitute.For <IRenderingSystem>(); }
public string PlayerID = "Player0"; //This is use for Rewired Asset #endregion void Awake() { Input_System = DefaultInput.GetInputSystem(PlayerID); //Get Which Input System is being used foreach (var i in inputs) { i.InputSystem = Input_System; //Update to all the Inputs the Input System } List_to_Dictionary(); }
private void Awake() { _inputSystem = GetComponent <IInputSystem>(); _playerController = GetComponent <IPlayerController>(); _enemyController = GetComponent <IEnemyController>(); _uiController = GetComponent <IUiController>(); _inputSystem.OnEscape = OnEscape; _inputSystem.OnEscapeUp = () => _timeBeforeQuit = 0; _status = GameStatus.Start; }
//private Vector2 touchOrigin = -Vector2.one; void Start() { inputSystem = Manager.GetInputSystem(); rb2d = GetComponent <Rigidbody2D>(); startSpeed = speed; moveLeft = new Vector2(-1, 0); moveRight = new Vector2(1, 0); moveDown = new Vector2(0, -1); moveUp = new Vector2(0, 1); }