diff --git a/blueberryPeak/Assets/Scripts/PlayerInteraction.cs b/blueberryPeak/Assets/Scripts/PlayerInteraction.cs index a927151..35805ed 100644 --- a/blueberryPeak/Assets/Scripts/PlayerInteraction.cs +++ b/blueberryPeak/Assets/Scripts/PlayerInteraction.cs @@ -28,7 +28,7 @@ public class PlayerInteraction : MonoBehaviour DialogAction.action.performed += onDialogContinue; dialogManager = dialogManagerObject.GetComponent(); - + print(dialog.Length); } void OnInteract(InputAction.CallbackContext context) @@ -64,8 +64,7 @@ public class PlayerInteraction : MonoBehaviour void onDialogContinue(InputAction.CallbackContext context) { - - if (context.performed && dialog != null) + if (context.performed && dialog != null && dialog.Length > 0) { // scroll the dialog only if there is text to be shown @@ -87,6 +86,10 @@ public class PlayerInteraction : MonoBehaviour { } + public int GetBlueberryCount() + { + return blueberryCount; + } public void CollectBlueberry(int newBlueberries) { diff --git a/blueberryPeak/Assets/Scripts/PlayerMovement.cs b/blueberryPeak/Assets/Scripts/PlayerMovement.cs index 4097f44..236cfe7 100644 --- a/blueberryPeak/Assets/Scripts/PlayerMovement.cs +++ b/blueberryPeak/Assets/Scripts/PlayerMovement.cs @@ -20,6 +20,15 @@ public class PlayerMovement : MonoBehaviour private Vector3 inputDirection = Vector3.zero; private CharacterController controller; + void Awake() + { + if (cameraTransform == null) + { + cameraTransform = Camera.main.transform; + } + } + + void Start() { controller = GetComponent();