private void InitControls(List <NPortInfoT> allPorts, bool hasCds, ref SystemInfo si)
 {
     _controllerAdapter = new ControllerAdapter(
         allPorts, _syncSettingsActual.PortDevices, OverrideButtonName, hasCds, ref si, ComputeHiddenPorts(),
         _controllerDeckName);
     _nyma.SetInputDevices(_controllerAdapter.Devices);
     ControllerDefinition = _controllerAdapter.Definition;
 }
Example #2
0
        static void Main(string[] args)
        {
            var xbox = new XBox();

            xbox.Play();

            var playStation = new PlayStation();

            playStation.Play();

            var adapter = new ControllerAdapter();

            xbox.Play(adapter);
        }
Example #3
0
        /// <summary>
        /// Initializes the motor
        /// </summary>
        /// <param name="brain"><see cref="ThirdPersonBrain"/> calling the initialization</param>
        public void Init(ThirdPersonBrain brain)
        {
            m_MainCamera                     = Camera.main;
            m_GameObject                     = brain.gameObject;
            m_Transform                      = brain.transform;
            m_ThirdPersonBrain               = brain;
            m_CharacterInput                 = brain.thirdPersonInput;
            m_ControllerAdapter              = brain.controllerAdapter;
            m_Animator                       = m_GameObject.GetComponent <Animator>();
            m_AverageForwardVelocity         = new SlidingAverage(m_Configuration.jumpGroundVelocityWindowSize);
            m_ExplorationAverageForwardInput = new SlidingAverage(m_Configuration.forwardInputWindowSize);
            m_StrafeAverageForwardInput      = new SlidingAverage(m_Configuration.strafeInputWindowSize);
            m_StrafeAverageLateralInput      = new SlidingAverage(m_Configuration.strafeInputWindowSize);
            m_PreviousInputs                 = new SizedQueue <Vector2>(m_Configuration.bufferSizeInput);
            movementMode                     = ThirdPersonMotorMovementMode.Exploration;

            EndStrafe();
        }
Example #4
0
    void Start()
    {
        Position = SelectChoice.None;
        mySM     = GameObject.Find("Managers").GetComponent <SelectionManager>();
        if (gameObject.name == "Controller1")
        {
            myNum = 0;
        }
        else
        {
            myNum = 1;
        }

        mySM.UpdateSelection(Position, myNum);

        gameObject.AddComponent <ControllerAdapter>();
        myCA = GetComponent <ControllerAdapter>();
        //Debug.Log(gameObject.name + " run Initialize for " + myNum);
        myCA.Initialize(myNum);
        GameStateManager.onSetControls  += SetControllerAdapter;
        GameStateManager.onPreLoadLevel += UnSub;
    }
Example #5
0
 private void InitControls(List <NPortInfoT> allPorts)
 {
     _controllerAdapter = new ControllerAdapter(allPorts, _syncSettingsActual.PortDevices, ButtonNameOverrides);
     _nyma.SetInputDevices(_controllerAdapter.Devices);
     ControllerDefinition = _controllerAdapter.Definition;
 }
 private void InitControls()
 {
     _controllerAdapter = new ControllerAdapter(_nyma, _syncSettingsActual.PortDevices);
     _nyma.SetInputDevices(_controllerAdapter.Devices);
     ControllerDefinition = _controllerAdapter.Definition;
 }
Example #7
0
 public void Play(ControllerAdapter adapter)
 {
     Controller = adapter.outController;
     Play();
 }