void Start() { inputManager = FPEInputManager.Instance; if (!inputManager) { Debug.Log("FPEMouseLook:: Cannot find an instance of FPEInputManager in the scene. Mouse look will not function correctly!"); } }
void Awake() { if (_instance != null) { Debug.LogWarning("FPEInputManager:: Duplicate instance of FPEInputManager, deleting second one."); Destroy(this.gameObject); } else { _instance = this; DontDestroyOnLoad(this.gameObject); } // Note: The friendly names given to each button/axis below is NOT the same as the strings defined // in the Project Settings > Input list. These friendly names are here for user-friendly debugging // and other display that might be required. // Add all the virtual buttons you want to poll later from other scripts FPEVirtualButtons.Add(eFPEInput.FPE_INPUT_INTERACT, new FPEInputButton(eFPEInput.FPE_INPUT_INTERACT, "Interact")); FPEVirtualButtons.Add(eFPEInput.FPE_INPUT_EXAMINE, new FPEInputButton(eFPEInput.FPE_INPUT_EXAMINE, "Examine")); FPEVirtualButtons.Add(eFPEInput.FPE_INPUT_ZOOM, new FPEInputButton(eFPEInput.FPE_INPUT_ZOOM, "Zoom")); FPEVirtualButtons.Add(eFPEInput.FPE_INPUT_CLOSE, new FPEInputButton(eFPEInput.FPE_INPUT_CLOSE, "Close")); FPEVirtualButtons.Add(eFPEInput.FPE_INPUT_PUT_IN_INVENTORY, new FPEInputButton(eFPEInput.FPE_INPUT_PUT_IN_INVENTORY, "Put In Inventory")); FPEVirtualButtons.Add(eFPEInput.FPE_INPUT_MENU, new FPEInputButton(eFPEInput.FPE_INPUT_MENU, "Menu")); FPEVirtualButtons.Add(eFPEInput.FPE_INPUT_MENU_PREVIOUS_TAB, new FPEInputButton(eFPEInput.FPE_INPUT_MENU_PREVIOUS_TAB, "Menu Previous Tab")); FPEVirtualButtons.Add(eFPEInput.FPE_INPUT_MENU_NEXT_TAB, new FPEInputButton(eFPEInput.FPE_INPUT_MENU_NEXT_TAB, "Menu Next Tab")); FPEVirtualButtons.Add(eFPEInput.FPE_INPUT_MENU_PREVIOUS_PAGE, new FPEInputButton(eFPEInput.FPE_INPUT_MENU_PREVIOUS_PAGE, "Menu Previous Page")); FPEVirtualButtons.Add(eFPEInput.FPE_INPUT_MENU_NEXT_PAGE, new FPEInputButton(eFPEInput.FPE_INPUT_MENU_NEXT_PAGE, "Menu Next Page")); FPEVirtualButtons.Add(eFPEInput.FPE_INPUT_JUMP, new FPEInputButton(eFPEInput.FPE_INPUT_JUMP, "Jump")); FPEVirtualButtons.Add(eFPEInput.FPE_INPUT_CROUCH, new FPEInputButton(eFPEInput.FPE_INPUT_CROUCH, "Crouch")); FPEVirtualButtons.Add(eFPEInput.FPE_INPUT_RUN, new FPEInputButton(eFPEInput.FPE_INPUT_RUN, "Run")); // Special first/last use detection, we also add VERTICAL and HORIZONTAL Virtual Buttons FPEVirtualButtons.Add(eFPEInput.FPE_INPUT_HORIZONTAL, new FPEInputButton(eFPEInput.FPE_INPUT_HORIZONTAL, "Horizontal Button")); FPEVirtualButtons.Add(eFPEInput.FPE_INPUT_VERTICAL, new FPEInputButton(eFPEInput.FPE_INPUT_VERTICAL, "Vertical Button")); // Add all the virtual axes you want to poll later from other scripts FPEVirtualAxes.Add(eFPEInput.FPE_INPUT_MOUSELOOKX, new FPEInputAxis(eFPEInput.FPE_INPUT_MOUSELOOKX, "Mouse Look X")); FPEVirtualAxes.Add(eFPEInput.FPE_INPUT_MOUSELOOKY, new FPEInputAxis(eFPEInput.FPE_INPUT_MOUSELOOKY, "Mouse Look Y")); FPEVirtualAxes.Add(eFPEInput.FPE_INPUT_LOOKX, new FPEInputAxis(eFPEInput.FPE_INPUT_LOOKX, "Look X")); FPEVirtualAxes.Add(eFPEInput.FPE_INPUT_LOOKY, new FPEInputAxis(eFPEInput.FPE_INPUT_LOOKY, "Look Y")); FPEVirtualAxes.Add(eFPEInput.FPE_INPUT_HORIZONTAL, new FPEInputAxis(eFPEInput.FPE_INPUT_HORIZONTAL, "Horizontal")); FPEVirtualAxes.Add(eFPEInput.FPE_INPUT_VERTICAL, new FPEInputAxis(eFPEInput.FPE_INPUT_VERTICAL, "Vertical")); // // Add any new inputs via their enum here // }