public ParseCommandFile(String filename) { if (filename == null) return; sr = (new ReadFileFactory()).GetSource(filename); CommandList = GetReplacementList(); }
public IDragonState HandleInput(DragonController dragon, IHandleInput input) { if (dragon.isFlinching) { return(new FlinchingState()); } if (dragon.executingAction) { return(null); } if (input.Action() != null) { if (input.Action().CommandName().Equals("fire")) { return(new FiringState()); } else if (input.Action().CommandName().Equals("deflect")) { return(new DeflectingState()); } else if (input.Action().CommandName().Equals("dash")) { return(new DashingState()); } } if (input.Move() != Vector3.zero) { return(new RunningState()); } return(null); }
public GameStateReadyToStart(IHandleInput inputHandler) { inputHandler.OnContinue.Subscribe(_ => { SwitchToNextGameState(); }); CustomDebug.CDebug.Log("Construct GameStateReadyToStart"); }
/// <summary> /// Injection and first initialization. /// </summary> private void Awake() { #region Self-Injection #if UNITY_EDITOR inputHandler = new UnityInputHandler(); #else inputHandler = new UnityInputHandler(); #endif #endregion }
// ReSharper disable once UnusedMethodReturnValue.Local private Boolean OnMouseInputWithCapture <TArgs>(IHandleInput <TArgs> capture, IVisualElement captureAsVisual, TArgs args, InputAction action, Boolean isButtonAction, out IHandleInput handledBy) where TArgs : IMouseInputEventArgs <TArgs> { if (!(_elementLocator.TryGetLastRenderBounds(captureAsVisual) is { } bounds)) { handledBy = default !;
#pragma warning restore 649 #endregion private void Awake() { #region Self-Injection input = new UnityInputHandler(); #endregion basicShortcuts = new Dictionary <KeyCode[], UnityEvent>(); shortcouts.ForEach(sc => AddListener(sc.keyEvent.Invoke, sc.keyCodes)); }
private void Start() { state = new IdlingState(); if (isRobot) { inputSource = GetComponent <DragonRobot>(); } else { inputSource = GetComponent <PlayerInput>(); } animator = GetComponent <Animator>(); }
void Start() { thrust = GetComponent <Thrust>(); rb = GetComponent <Rigidbody>(); if (curentSystemPlatform == Platform.Windows) { handleInput = new HandleWindows(); } else if (curentSystemPlatform == Platform.Android) { handleInput = new HandleAndroid(); } }
private void Start() { Instance = this; if (InputAction == null) { InputAction = new HandleInput(); } //Spawn all pieces SpawnAllChessPieces(); WhiteCamera.enabled = true; BlackCamera.enabled = false; }
public IDragonState HandleInput(DragonController dragonController, IHandleInput input) { if (input.Move() == Vector3.zero) { return(new IdlingState()); } else if (input.Move() != Vector3.zero) { return(new RunningState()); } else { return(null); } }
public GameUI(IMazeIntegration mazeIntegration, IHandleInput handleInput, ILoadMaze loadMaze, IRenderMaze renderMaze, ILoadPlayer loadPlayer, IExecuteUserAction executeUserAction) { _mazeIntegration = mazeIntegration; _handleInput = handleInput; _loadMaze = loadMaze; _renderMaze = renderMaze; _loadPlayer = loadPlayer; _executeUserAction = executeUserAction; InitializeSettings(); PlayGame(); Console.WriteLine(Constants.PlayerConstants.EOG); Console.ReadKey(); }
private static void InitHandler() { // First, just try to use the legacy input, see if its working. // The InputSystem package may be present but not actually activated, so we can find out this way. if (LegacyInput.TInput != null) { try { m_inputModule = new LegacyInput(); CurrentType = InputType.Legacy; // make sure its working GetKeyDown(KeyCode.F5); ExplorerCore.Log("Initialized Legacy Input support"); return; } catch { // It's not working, we'll fall back to InputSystem. } } if (InputSystem.TKeyboard != null) { try { m_inputModule = new InputSystem(); CurrentType = InputType.InputSystem; ExplorerCore.Log("Initialized new InputSystem support."); return; } catch (Exception ex) { ExplorerCore.Log(ex); } } ExplorerCore.LogWarning("Could not find any Input Module Type!"); m_inputModule = new NoInput(); CurrentType = InputType.None; }
public static void Init() { if (InputSystem.TKeyboard != null || (ReflectionHelpers.LoadModule("Unity.InputSystem") && InputSystem.TKeyboard != null)) { m_inputModule = new InputSystem(); CurrentType = InputType.InputSystem; } else if (LegacyInput.TInput != null || (ReflectionHelpers.LoadModule("UnityEngine.InputLegacyModule") && LegacyInput.TInput != null)) { m_inputModule = new LegacyInput(); CurrentType = InputType.Legacy; } if (m_inputModule == null) { ExplorerCore.LogWarning("Could not find any Input module!"); m_inputModule = new NoInput(); CurrentType = InputType.None; } }
public IDragonState HandleInput(DragonController dragon, IHandleInput input) { Debug.Log("Flinchstate Active"); if (dragon.isFlinching) { return(null); } if (input.Move() == Vector3.zero) { return(new IdlingState()); } else if (input.Move() != Vector3.zero) { return(new RunningState()); } else { return(null); } }
public void DispatchMouseInput(World world, MouseInput mi) { if (mi.Event == MouseInputEvent.Move) mousePos = mi.Location; if (dragRegion != null) { dragRegion.HandleInput( world, mi ); if (mi.Event == MouseInputEvent.Up) dragRegion = null; return; } dragRegion = regions.FirstOrDefault(r => r.HandleInput(world, mi)); if (mi.Event != MouseInputEvent.Down) dragRegion = null; }
public IDragonState HandleInput(DragonController dragonController, IHandleInput input) { return(null); }
public GameStateInitialToIntro(IHandleInput handleInput) { handleInput.OnContinue.Subscribe(_ => SwitchNextToGameState()); }