Bär wartet nach aufwachen etc

This commit is contained in:
2026-01-25 17:22:11 +01:00
parent 6504147456
commit e38a2b05e7
384 changed files with 132389 additions and 54 deletions
+19 -4
View File
@@ -2,6 +2,7 @@ using System;
using System.Collections;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UI;
public class PlayerMove : MonoBehaviour
{
@@ -24,7 +25,10 @@ public class PlayerMove : MonoBehaviour
[SerializeField] private string inputNameVertical;
public Transform player;
public Slider awarenessSlider;
private bool walking = true;
private void Start()
{
@@ -104,7 +108,11 @@ public class PlayerMove : MonoBehaviour
}
}
transform.Translate(moveDirection * speed * Time.deltaTime, Space.World);
if (moveDirection != Vector3.zero && walking)
{
StartCoroutine(Step(0.3f));
}
}
@@ -117,8 +125,15 @@ public class PlayerMove : MonoBehaviour
speed = basespeed;
}
IEnumerator Step(float delay)
{
walking = false;
yield return new WaitForSeconds(delay);
awarenessSlider.value += 1f;
walking = true;
}
}