예제 #1
0
        private void Awake()
        {
            Cursor.lockState = CursorLockMode.Locked;
            Cursor.visible   = false;

            // Find main camera if it was not attached in hierarchy
            if (m_Camera == null)
            {
                if (Camera.main == null)
                {
                    Debug.LogError("There is no Camera in the scene. Please add a camera!");
                }
                else
                {
                    m_Camera = Camera.main.transform;
                }
            }

            m_FreeLookCameras = FindObjectsOfType <CinemachineFreeLook>();

            // Initialize buttons
            jumpButton   = new InputButton(m_JumpInputName);
            walkButton   = new InputButton(m_WalkInputName);
            rollButton   = new InputButton(m_RollInputName);
            crouchButton = new InputButton(m_CrouchInputName);
            crawlButton  = new InputButton(m_CrawlInputName);
            dropButton   = new InputButton(m_DropInputName);

            toggleWeaponButton = new InputButton(m_ToggleWeaponInputName);
            rightWeaponButton  = new InputButton(m_RightWeaponInputName);
            leftWeaponButton   = new InputButton(m_LeftWeaponInputName);
            fireButton         = new InputButton(m_FireInputName);
            reloadButton       = new InputButton(m_ReloadInputName);
            zoomButton         = new InputButton(m_ZoomInputName);

            interactButton = new InputButton(m_InteractInputName);

            action01 = new InputButton(m_ExtraAction01);
            action02 = new InputButton(m_ExtraAction02);
            action03 = new InputButton(m_ExtraAction03);
        }
예제 #2
0
 public void SetInputManager(UnityInputManager manager)
 {
     m_InputManager = manager;
     m_Button       = manager.GetInputReference(m_InputReference);
 }
예제 #3
0
 private void Reset()
 {
     m_InputToEnter = GetComponent <UnityInputManager>().jumpButton;
 }