✨ fixed issues in PlayerInteraction & PlayerMovement
This commit is contained in:
parent
21423930ce
commit
483eeb54a8
@ -28,7 +28,7 @@ public class PlayerInteraction : MonoBehaviour
|
||||
DialogAction.action.performed += onDialogContinue;
|
||||
|
||||
dialogManager = dialogManagerObject.GetComponent<DialogManager>();
|
||||
|
||||
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)
|
||||
{
|
||||
|
@ -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<CharacterController>();
|
||||
|
Loading…
Reference in New Issue
Block a user