update to unity 6.2, add save system and quest system

This commit is contained in:
2025-12-02 16:52:02 -06:00
parent aea12ab091
commit c7dca2f8e5
23 changed files with 767 additions and 48 deletions
+25 -5
View File
@@ -6,6 +6,10 @@ public class PlayerController : MonoBehaviour
public Shovel Shovel;
public float walkSpeed;
float digTime = 0.9f;
float digTimestamp = 0;
bool isDigging = false;
Interactable nearestInteractable;
// Start is called once before the first execution of Update after the MonoBehaviour is created
@@ -17,9 +21,13 @@ void Start()
// Update is called once per frame
void Update()
{
RotatePlayerTowardMouse();
Walk();
TryInteract();
if (!isDigging)
{
RotatePlayerTowardMouse();
Walk();
TryInteract();
}
DigDetector();
}
@@ -31,9 +39,21 @@ void Walk()
void DigDetector()
{
if (Input.GetMouseButtonDown(0))
if (!isDigging)
{
Shovel.Dig();
if (Input.GetMouseButtonDown(0))
{
Shovel.Dig();
isDigging = true;
digTimestamp = Time.time + digTime; // fuck coroutines fr fr
}
}
else
{
if (Time.time > digTimestamp)
{
isDigging = false;
}
}
}