Esempio n. 1
0
        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>
        /// 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);
        }
Esempio n. 3
0
        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();
        }
        void Awake()
        {
            Input_System           = DefaultInput.GetInputSystem(PlayerID);         //Get Which Input System is being used
            Horizontal.InputSystem = Vertical.InputSystem = Input_System;
            //UpDown.InputSystem = Input_System;

            foreach (var i in inputs)
            {
                i.InputSystem = Input_System;                                       //Update to all the Inputs the Input System
            }
            List_to_Dictionary();

            InitializeCharacter();
        }
Esempio n. 5
0
        protected void Awake()
        {
            Cam   = GetComponentInChildren <Camera>();
            CamT  = GetComponentInChildren <Camera>().transform;
            Pivot = Cam.transform.parent;

            currentState = null;
            NextState    = null;

            if (manager)
            {
                manager.SetCamera(this);
            }

            if (DefaultState)
            {
                Set_State(DefaultState);
            }

            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;


            ActiveFOV = Cam.fieldOfView;

            inputSystem = DefaultInput.GetInputSystem(PlayerID);

            Horizontal.InputSystem = Vertical.InputSystem = inputSystem;        //Update the Input System on the Axis
            defaultUpdate          = updateType;

            if (DefaultState == null)
            {
                // FreeLookCameraState defaault = ScriptableObject.CreateInstance< new FreeLookCameraState(Cam.fieldOfView, Pivot.localPosition, CamT.localPosition);

                DefaultState = ScriptableObject.CreateInstance <FreeLookCameraState>();

                DefaultState.CamFOV   = Cam.fieldOfView;
                DefaultState.PivotPos = Pivot.localPosition;
                DefaultState.CamPos   = CamT.localPosition;


                DefaultState.name = "Default State";

                OnStateChange.Invoke();
            }
        }
Esempio n. 6
0
        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
            }
            DInputs = new Dictionary <string, InputRow>();

            foreach (var item in inputs)
            {
                DInputs.Add(item.name, item);
            }
        }
Esempio n. 7
0
        void Awake()
        {
            InputSystem = DefaultInput.GetInputSystem(PlayerID);                   //Get Which Input System is being used

            //Update to all the Inputs to the active Input System
            Horizontal.InputSystem = Vertical.InputSystem = UpDown.InputSystem = InputSystem;
            foreach (var i in inputs)
            {
                i.InputSystem = InputSystem;
            }

            List_to_Dictionary();       //Convert the Inputs to Dic... easier to find
            InitializeCharacter();
            MoveCharacter = true;       //Set that the Character can be moved
        }
Esempio n. 8
0
        /// <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;

            Input_System = new DefaultInput();             //Set it as default the Unit Input System

#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");
            }
            return(Input_System);
#endif
#if OOTII_EI
            Input_System = new EasyInput();
#endif
            return(Input_System);
        }