public ClickToMoveMovementController(
     IInputController inputController,
     ICameraProvider cameraProvider)
 {
     _inputController = inputController;
     _cameraProvider = cameraProvider;
 }
Beispiel #2
0
        public BubblesClientGame(ScreenManager screenManager)
        {
            // Initialise Graphics
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferHeight = 768;
            graphics.PreferredBackBufferWidth = 1366;

            screenDimensions = new Vector2(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);

            // Initialise Input
            // Use this line to enable the Kinect
            //_input = new KinectControllerInput();

            // And this one to enable the Mouse (if you use both, Mouse is used)
            input = new MouseInput();
            input.Initialize(screenDimensions);

            // Initialise Content
            Content.RootDirectory = "Content";

            // Initialise Physics
            _world = new World(new Vector2(0, -2));

            // Initialise network
            this.ScreenManager = screenManager;
        }
 void Start()
 {
     m_currentState = HeroineState.Idle;
     m_inputController = InputFactory.GetCurrentInput ();
     m_animationStrategy = new AnimationStrategy (GetComponentInChildren<Animator> ());
     m_animationController.Setup (this);
     m_attackStrategy.Setup (this);
     m_movementController.Setup (this);
 }
Beispiel #4
0
        public ITank CreteTank(IInputController inputController, Transform spawnPoint)
        {
            var tankObject         = Instantiate(tankPrefab, spawnPoint.position, Quaternion.identity);
            var shootingController = tankObject.GetComponent <IShootingController>();

            _tank = tankObject.GetComponent <ITank>();
            _tank.Initialize(inputController, shootingController);
            return(_tank);
        }
Beispiel #5
0
 public IKeyEvent toIKeyEvent(IInputController inputController)
 {
     return(inputController.CreateKeyEvent(
                true,
                InputUtil.KeysToKey(Key),
                ControlPressed,
                AltPressed,
                ShiftPressed));
 }
Beispiel #6
0
 public BsPresenter(IBsView view, IBsHudView hudView, IBsModel model, IInputController input, ILog logger)
 {
     _view      = view;
     _hudView   = hudView;
     _model     = model;
     _input     = input;
     _logger    = logger;
     _selection = new BsSelection();
 }
Beispiel #7
0
 public CoreServices(IViewService view, IInputService input, IInputController inputController, ICollisionService collision, ISelectionService selection, ITimeService time, ITickService tick)
 {
     View            = view;
     Input           = input;
     InputController = inputController;
     Collision       = collision;
     Selection       = selection;
     Time            = time;
     Tick            = tick;
 }
Beispiel #8
0
 public Engine(IRenderer renderer, IInputController inputController,  ICommandFactory commandFactory, IBlobFactory blobFactory, IAttackFactory attackFactory, IBehaviorFactory behaviorFactory)
 {
     this.renderer = renderer;
     this.inputController = inputController;
     this.CommandFactory = commandFactory;
     this.blobs = new List<IBlob>();
     this.BlobFactory = blobFactory;
     this.AttackFactory = attackFactory;
     this.BehaviorFactory = behaviorFactory;
 }
Beispiel #9
0
 public PlayerBehaviour(IViewProvider <IPlayerView> viewProvider,
                        IInputController inputController,
                        IGameNotifications gameNotifications,
                        IGenerateMissile generateMissile)
 {
     _viewProvider      = viewProvider;
     _inputController   = inputController;
     _gameNotifications = gameNotifications;
     _generateMissile   = generateMissile;
 }
Beispiel #10
0
 public Engine(IRenderer renderer, IInputController inputController, ICommandFactory commandFactory, IBlobFactory blobFactory, IAttackFactory attackFactory, IBehaviorFactory behaviorFactory)
 {
     this.renderer        = renderer;
     this.inputController = inputController;
     this.CommandFactory  = commandFactory;
     this.blobs           = new List <IBlob>();
     this.BlobFactory     = blobFactory;
     this.AttackFactory   = attackFactory;
     this.BehaviorFactory = behaviorFactory;
 }
 public MainEngineController(ILevelFacade levelFacade,
                             IVisualElementsFacade visualElementsFacade,
                             IInputController inputController,
                             IInputFacade inputFacade,
                             IUIComponentFacade uiComponentFacade)
 {
     _inputController   = inputController;
     _rulesPacksFactory = new RulesPacksFactory();
     _engine            = new PipelineEngine(levelFacade, visualElementsFacade, inputFacade, uiComponentFacade);
 }
Beispiel #12
0
    private void Awake()
    {
#if UNITY_EDITOR
        _inputProvider = gameObject.AddComponent <MouseInputController>();
#elif UNITY_STANDALONE
        _inputProvider = gameObject.AddComponent <MouseInputController>();
#elif UNITY_ANDROID
        _inputProvider = gameObject.AddComponent <TouchInputController>();
#endif
        _ballMoveProvider = GetComponent <IBallMover>();
    }
 void Start()
 {
     // Get input controller.
     m_inputController = InputFactory.GetCurrentInputController();
     // Get movement controller.
     m_movement = GetComponent <MovementController>();
     // Get weapon controller (in children).
     m_weaponController = GetComponentInChildren <PlayerWeaponController> ();
     // Get thrust particles (in children).
     m_thrustEffect = GetComponentInChildren <ParticleSystem> ();
 }
Beispiel #14
0
        /// <summary>
        /// Method start.
        /// </summary>
        private void Start()
        {
            input = GetComponent <InputManager>();
            iv    = GetComponent <View>();

            gm = new GameManager(input, iv);

            Thread game = new Thread(new ThreadStart(gm.GameLoop));

            game.Start();
        }
Beispiel #15
0
        private void Injection(IGrabSystem grabSystem, IInputController inputController)
        {
            _grabSystem      = grabSystem;
            _inputController = inputController;

            _grabber              = GetComponent <IGrabber>();
            _grabber.OnTouched   += HandleGrabberOnTouched;
            _grabber.OnUntouched += HandleGrabberOnUntouched;

            _injected = true;
        }
Beispiel #16
0
        private void Start()
        {
            m_inputController = InputFactory.GetCurrentInputController();
            m_direction       = Vector2.right;
            m_startMoveSpeed  = m_moveSpeed;
            m_tail            = new List <Transform> ();

            GameUI.Instance.UpdateLength(1);

            m_moveCoroutine = StartCoroutine(Move());
        }
        private void Awake()
        {
            _anim      = GetComponentInChildren <AnimationHandler>();
            _move      = GetComponent <CharacterMovement>();
            _stats     = GetComponent <CharacterStats>();
            _coll      = GetComponent <CollisionHandler>();
            _weaponInv = GetComponent <WeaponInventory>();
            _input     = GetComponent <IInputController>();
            //_contrVib = GetComponent<ControllerVibration>();

            _coll.OnGrounded += () => _isDiveKicking = false;
        }
    void Start()
    {
        Camera camera = Camera.main;

        if (camera == null)
        {
            GameObject cameraGameObject = Instantiate(new GameObject());
            camera = cameraGameObject.AddComponent <Camera> ();
        }

        cameraController = camera.GetComponent <ICameraController> ();
        if (cameraController == null)
        {
            cameraController = camera.gameObject.AddComponent <DynamicCameraController> ();
        }

        specialBox = GameObject.FindGameObjectWithTag("Special Box");
        if (specialBox == null)
        {
            specialBox = new GameObject();
        }

        GameObject player = GameObject.FindGameObjectWithTag("Player");

        playerInputController = player.GetComponent <IInputController> ();
        if (player == null || playerInputController == null)
        {
            playerInputController = new NullInputController();
        }
        playerInputController.SetCameraController(cameraController);
        playerInputController.SetCameraMode(
            CameraMode.THIRD_PERSON,
            Vector3.zero
            );

        playerVirtualController = player.GetComponent <IVirtualController> ();
        if (player == null || playerVirtualController == null)
        {
            playerVirtualController = new NullVirtualController();
        }

        playerHealthController = player.GetComponent <IHealthController> ();
        if (playerHealthController == null)
        {
            playerHealthController = new NullHealthController();
        }

        CameraModeTrigger [] cameraModeTriggers = ( CameraModeTrigger [] )GameObject.FindObjectsOfType <CameraModeTrigger> ();
        foreach (CameraModeTrigger cameraModeTrigger in cameraModeTriggers)
        {
            cameraModeTrigger.SetCameraModeListener(this);
        }
    }
Beispiel #19
0
 public MainWindowVM(
     IBottomPanelVM bottomPanelVM,
     ICentralPanelVM centralPanelVM,
     ITotalCounterVM totalCounterVM,
     IInputController inputController)
 {
     BottomPanelVM  = bottomPanelVM;
     CentralPanelVM = centralPanelVM;
     CentralPanelVM.ItemsPositionChanged += RequestScrollDown;
     TotalCounterVM       = totalCounterVM;
     this.inputController = inputController;
 }
        public void Init()
        {
            targetFinder = GetComponent <ITargetFinder>();

            inputController = ControllersManager.Instance.GetController <IInputController>();

            UpdateManager.Instance.onUpdate += CustomUpdate;

            thisTransform = transform;

            inputController.onFire += OnFireHandler;
        }
 void Start()
 {
     input = GameManager.Instance.Input;
     animator.SetFloat("vertical", 1f);
     defaultFieldOfView  = headCamera.fieldOfView;
     animator.speed      = Settings.DefaultAnimatorSpeed;
     currentVelocity     = Settings.DefaultMovementVelocity;
     currentStamina      = Settings.DefaultStamina;
     currentMovementLine = Settings.DefaultMovementLine;
     transform.ChangePosition("z", MovementHelper.LinePositions[currentMovementLine]);
     cooldownCanvas.gameObject.SetActive(false);
     staminaCanvas.enabled = false;
 }
Beispiel #22
0
    internal void Awake()
    {
        _characterController = GetComponent <CharacterController>();
        _camera  = GetComponentInChildren <Camera>();
        _builder = FindObjectOfType <Builder>();

#if UNITY_STANDALONE
        _inputController = gameObject.AddComponent <StandaloneInputController>();
#endif
#if UNITY_ANDROID || UNITY_IOS
        _inputController = gameObject.AddComponent <TouchscreenInputController>();
#endif
    }
Beispiel #23
0
    public bool fallNodes        = true;         /*true-- Allows the pathfinding agent to use 'fall' nodes*/

    void Awake()
    {
        _controller = GetComponent <CharacterController2D>();
        _box        = GetComponent <BoxCollider2D>();
        _pathAgent  = GetComponent <PathfindingAgent>();
        _ai         = GetComponent <AiController>();
        //_anim = transform.Find("Graphics").GetComponent<Animator>();
        _graphics = transform.Find("Graphics").gameObject;     /*useful for preventing things from flipping when character is facing left*/
        _input    = GetComponent <IInputController>();

        /*allow movement abilities to access character script*/
        jump.SetCharacter(this);
    }
        private void CreateNewInputControl()
        {
            switch (m_controlType)
            {
            case ControlType.None:
                _inputController = null;
                break;

            case ControlType.SampleInputController:
                _inputController = new SampleInputController();
                break;
            }
        }
Beispiel #25
0
 public LocationController(UnitView.Factory unit_factory,
                           Settings settings,
                           LocationModel location_model,
                           SignalBus signal_bus,
                           IInputController input_controller)
 {
     this._signal_bus       = signal_bus;
     this._location_model   = location_model;
     this._input_controller = input_controller;
     this._unit_factory     = unit_factory;
     this._settings         = settings;
     this._camera_bounds    = Camera.main.OrthographicBounds();
 }
        private void Awake()
        {
            if (Instance != null && Instance != this)
            {
                DestroyImmediate(gameObject);
                return;
            }

            Instance = this;
            DontDestroyOnLoad(gameObject);

            Input.multiTouchEnabled = false;
            _mouseData = MouseDataClass.GetDefaultFromUpdate();
        }
 public InputServer(ILog log, IInputController inputController)
 {
     this.log = log;
     this.inputController = inputController;
     server = new OscServer(TransportType.Udp, IPAddress.Any, DEFAULT_VIP_PORT);
     server.RegisterMethod(JOYPAD_BUTTON_EVENT);
     server.RegisterMethod(MOUSE_EVENT);
     server.RegisterMethod(SCROLL_EVENT);
     server.RegisterMethod(KEYBOARD_EVENT);
     server.RegisterMethod(VOLUME_EVENT);
     server.MessageReceived += new OscMessageReceivedHandler(server_MessageReceived);
     server.Start();
     log.Log(LogLevel.Info, "Starting Input Server");
 }
Beispiel #28
0
    private void Update()
    {
        for (int i = controllers.Count - 1; i >= 0; i--)
        {
            IInputController controller = controllers[i];
            if (controller != null && controller.ProcessInput())
            {
                break;
            }
        }

        controllers.AddRange(controllersToAdd);
        controllersToAdd.Clear();
    }
Beispiel #29
0
 public InputServer(ILog log, IInputController inputController)
 {
     this.log             = log;
     this.inputController = inputController;
     server = new OscServer(TransportType.Udp, IPAddress.Any, DEFAULT_VIP_PORT);
     server.RegisterMethod(JOYPAD_BUTTON_EVENT);
     server.RegisterMethod(MOUSE_EVENT);
     server.RegisterMethod(SCROLL_EVENT);
     server.RegisterMethod(KEYBOARD_EVENT);
     server.RegisterMethod(VOLUME_EVENT);
     server.MessageReceived += new OscMessageReceivedHandler(server_MessageReceived);
     server.Start();
     log.Log(LogLevel.Info, "Starting Input Server");
 }
Beispiel #30
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();

        // log
        ILog log = new TextViewLog(this.textview1);

        // input controller
        inputController = new LinInputController();

        // services
        dserver = new DiscoveryServer(log);
        iserver = new InputServer.InputServer(log, inputController);
    }
Beispiel #31
0
        public void Initialize(IInputController inputController, IShootingController shootingController)
        {
            _inputController    = inputController;
            _shootingController = shootingController;
            _shootingController.Initialize();

            _inputController.OnNextWeapon     += () => _shootingController.ChangeWeapon(WeaponChange.Next);
            _inputController.OnPreviousWeapon += () => _shootingController.ChangeWeapon(WeaponChange.Previous);

            _inputController.OnSpace   += () => Brake(brakeForce);
            _inputController.OnSpaceUp += () => Brake(0);
            _inputController.OnFire    += OnFire;

            _axleInfos.AddRange(new[] { frontAxle, backAxle });
        }
Beispiel #32
0
 public UpgradedWarEngine(
     IRenderer renderer,
     IInputController inputController,
     IUnitFactory unitFactory,
     IArmyStructureFactory armyStructureFactory,
     ICommandFactory commandFactory,
     IContinent continent)
     : base(renderer,
     inputController,
     unitFactory,
     armyStructureFactory,
     commandFactory,
     continent)
 {
 }
Beispiel #33
0
 public WarEngine(
     IRenderer renderer, 
     IInputController inputController, 
     IUnitFactory unitFactory,
     IArmyStructureFactory armyStructureFactory,
     ICommandFactory commandFactory,
     IContinent continent)
 {
     this.renderer = renderer;
     this.inputController = inputController;
     this.UnitFactory = unitFactory;
     this.ArmyStructureFactory = armyStructureFactory;
     this.CommandFactory = commandFactory;
     this.Continent = continent;
 }
Beispiel #34
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build ();

        // log
        ILog log = new TextViewLog(this.textview1);

        // input controller
        inputController = new LinInputController();

        // services
        dserver = new DiscoveryServer(log);
        iserver = new InputServer.InputServer(log, inputController);
    }
Beispiel #35
0
 public WarEngine(
     IRenderer renderer,
     IInputController inputController,
     IUnitFactory unitFactory,
     IArmyStructureFactory armyStructureFactory,
     ICommandFactory commandFactory,
     IContinent continent)
 {
     this.renderer             = renderer;
     this.inputController      = inputController;
     this.UnitFactory          = unitFactory;
     this.ArmyStructureFactory = armyStructureFactory;
     this.CommandFactory       = commandFactory;
     this.Continent            = continent;
 }
Beispiel #36
0
        private void Bind()
        {
            _uiComponentFacade    = new UIComponentFacade();
            _levelFacade          = new LevelFacade(_uiComponentFacade);
            _inputController      = new InputController();
            _visualElementsFacade = new VisualElementsFacade();
            _inputFacade          = new InputFacade(_inputController);

            _mainEngineController = new MainEngineController(_levelFacade, _visualElementsFacade, _inputController, _inputFacade, _uiComponentFacade);

            var objUpdateController = new GameObject("UpdateController");

            _updateController = objUpdateController.AddComponent <UpdateController>();
            _updateController.AddComponent(UpdatablesName.MainEngineController, _mainEngineController);
            _updateController.AddComponent(UpdatablesName.InputController, _inputController);
        }
Beispiel #37
0
 public Engine(
     IRenderer renderer,
     IInputController inputController,
     ICommandFactory commandFactory,
     IFieldOfPLay fieldOfPLay,
     IAttackFactory attackFactory,
     IBehaviourFactory behaviourFactory)
 {
     this.renderer = renderer;
     this.inputController = inputController;
     this.CommandFactory = commandFactory;
     this.FieldOfPLay = fieldOfPLay;
     AttackFactory = attackFactory;
     BehaviourFactory = behaviourFactory;
     this.ReportEvents = false;
 }
Beispiel #38
0
        public RootController()
        {
            // initialize this agent
            presentation = new RootPresentation();
            abstraction  = new RootAbstraction();

            // initialize input agent
            input = new InputController(this);
            presentation.SetInputUI(input.GetUI());

            // initialize output agent
            output = new OutputController(this);
            presentation.SetOutputUI(output.GetUI());

            // show the window
            presentation.RegisterOnClose((sender, e) => { Shutdown(); });
            presentation.ShowUI();
        }
Beispiel #39
0
        private void ReadOwnership(NetPacketReader reader, int length)
        {
            int startPosition = reader.Position;

            while (reader.Position - startPosition < length)
            {
                int id = reader.GetInt();

                // If this remote is not the arbiter, the one sending the data must be.
                world.GetStatefulObject(id).Ownable.Read(reader, arbiter);

                IInputController inputController = world.statefulObjects[id].GetComponent <IInputController>();

                if (inputController != null)
                {
                    inputController.SetEnabled(world.GetStatefulObject(id).Ownable.HasOwnership(remoteID));
                }
            }
        }
Beispiel #40
0
        protected override void Awake()
        {
            base.Awake();

            // input
#if UNITY_EDITOR
            input = gameObject.AddComponent<DeviceInput>();
#else
            if (InputManager.ActiveInput == InputManager.Inputs.Touch)
            {
                input = gameObject.AddComponent<TouchInput>();
            }
            else
            {
                input = gameObject.AddComponent<DeviceInput>();
            }
#endif

            // setup
            myMoney = new MoneyManager();
            Augmentations = GetComponent<AugmentationManager>();
            Weapons = GetComponent<WeaponManager>() ?? gameObject.AddComponent<WeaponManager>();

            // create states
            stateMachine = new StateMachine(this, MovingState);
            stateMachine.CreateState(MovingState, MovingEnter, MovingExit);
            stateMachine.CreateState(BarrelRollingState, BarrelRollingEnter, BarrelRollingExit);
            stateMachine.CreateState(DyingState, DyingEnter, info => { });
        }
		// ================================================================================
		//  private methods
		// --------------------------------------------------------------------------------

		protected bool Init()
        {
            if (Instance != null)
            {
                return false;
            }

            Instance = this;

			TextManagerInit textManagerInit = GetComponentInChildren<TextManagerInit>();
			if (textManagerInit != null)
			{
				textManagerInit.Init();
			}

            baseAudioManager = GetComponent<BaseAudioManager>();
			baseNavigationInput = GetComponent<BaseNavigationInput>();
			messenger = GetComponent<Messenger>();
			applicationInfo = new ApplicationInfo();

			gamepadInput = transform.GetInterface<IGamepadInput>();
			inputController = transform.GetInterface<IInputController>();

			// object shall persist through all levels
			DontDestroyOnLoad(gameObject);

            return true;
        }
Beispiel #42
0
 public void setInputController(IInputController controller)
 {
     inputController = controller;
 }
 public UseArrowKeysMovementController(
     IInputController inputController)
 {
     _inputController = inputController;
 }
		public void SetInputController(IInputController inputController) {
			this.inputController = inputController;
		}
		[SetUp] public void Init()
		{ 
			input = GetInputMock ();
			inputManager = GetControllerMock (input);	
		}
Beispiel #46
0
 public Engine(IController controller, IRenderer renderer, IInputController inputController)
 {
     this.Controller = controller;
     this.Renderer = renderer;
     this.Reader = inputController;
 }
 void Start()
 {
     // Get input controller.
     m_inputController = InputFactory.GetCurrentInputController ();
     // Get movement controller.
     m_movement = GetComponent<MovementController>();
     // Get weapon controller (in children).
     m_weaponController = GetComponentInChildren<PlayerWeaponController> ();
     // Get thrust particles (in children).
     m_thrustEffect = GetComponentInChildren<ParticleSystem> ();
 }
		private InputManagerController GetControllerMock(IInputController input) {
			var inputManager = Substitute.For<InputManagerController> ();
			inputManager.SetInputController (input);
			return inputManager;
		}