new void Start() { //rb = GetComponent<Rigidbody>(); controller = GetComponent <CharacterController>(); playerCurrentRoom = ""; playerRoomCheck = ""; /*horizontalAxis = "POnHorizontal"; * verticalAxis = "POnVertical"; * jump = "POnJump"; * interact = "Button On";*/ horizontalAxis = PlayerInputTranslator.GetHorizontalAxis(Player.ON); verticalAxis = PlayerInputTranslator.GetVerticalAxis(Player.ON); jump = PlayerInputTranslator.GetJump(Player.ON); interact = PlayerInputTranslator.GetLeftInteract(Player.ON); reset = PlayerInputTranslator.GetReset(Player.ON); pickUp = PlayerInputTranslator.GetPickup(Player.ON); base.Start(); }
// Update is called once per frame void Update() { //if (!LevelController.gameGoing()) return; try { if (Input.GetButton(PlayerInputTranslator.GetLeftInteract(Player.ON))) { if (Time.time - lastPressedOn > pressThreshold) { OnInteract(Parameters.OnPlayer); lastPressedOn = Time.time; } } if (Input.GetButton(PlayerInputTranslator.GetLeftInteract(Player.OFF))) { if (Time.time - lastPressedOn > pressThreshold) { Parameters.OffPlayer.GetComponent <Animator>().SetTrigger("Use Wrong Arm"); } } if (Input.GetButton(PlayerInputTranslator.GetRightInteract(Player.OFF))) { if (Time.time - lastPressedOff > pressThreshold) { OnInteract(Parameters.OffPlayer); lastPressedOff = Time.time; } } if (Input.GetButton(PlayerInputTranslator.GetRightInteract(Player.ON))) { if (Time.time - lastPressedOn > pressThreshold) { Parameters.OnPlayer.GetComponent <Animator>().SetTrigger("Use Wrong Arm"); } } if ((Input.GetButton(PlayerInputTranslator.GetMenu(Player.ON)) || Input.GetButton(PlayerInputTranslator.GetMenu(Player.OFF))) || (LevelController.InMenue && (Input.GetButton(PlayerInputTranslator.GetPickup(Player.ON)) || Input.GetButton(PlayerInputTranslator.GetPickup(Player.OFF)))) ) { if ((DateTime.Now - lastPressedOnMenue).TotalSeconds > pressThresholdMenue) { LevelController.ToggleMenue(); lastPressedOnMenue = DateTime.Now; } } if (Input.GetButtonUp(PlayerInputTranslator.GetDismiss(Player.ON)) || Input.GetButtonUp(PlayerInputTranslator.GetDismiss(Player.OFF))) { print("y"); hudController.DismissDialogue(); npc.Dismiss(); } /* * if (Input.GetButton(PlayerInputTranslator.GetMenu(Player.OFF))) * { * if (Time.time - lastPressedOffMenue > pressThresholdMenue) * { * LevelController.ToggleMenue(); * lastPressedOffMenue = Time.time; * } * }*/ } catch (System.NullReferenceException) { ; } }