bug fixes
This commit is contained in:
@@ -16,6 +16,7 @@ public class HatRespawn : MonoBehaviour
|
||||
{
|
||||
if (isDropped && Time.time - lastInteractionTime > respawnTime)
|
||||
{
|
||||
Debug.Log("Hat has been inactive for too long. Respawning...");
|
||||
RespawnHat();
|
||||
}
|
||||
}
|
||||
@@ -24,6 +25,7 @@ public class HatRespawn : MonoBehaviour
|
||||
{
|
||||
if (collision.gameObject.CompareTag("Platformer Hazard"))
|
||||
{
|
||||
Debug.Log("Hat collided with Platformer Hazard. Respawning...");
|
||||
RespawnHat();
|
||||
}
|
||||
}
|
||||
@@ -32,12 +34,14 @@ public class HatRespawn : MonoBehaviour
|
||||
{
|
||||
lastInteractionTime = Time.time;
|
||||
isDropped = false;
|
||||
Debug.Log("Hat interacted with. Resetting timer.");
|
||||
}
|
||||
|
||||
public void OnHatDropped() // Resets the timer when the hat is dropped
|
||||
{
|
||||
lastInteractionTime = Time.time;
|
||||
isDropped = true;
|
||||
Debug.Log("Hat dropped. Starting respawn timer.");
|
||||
}
|
||||
|
||||
private void RespawnHat() // Respawns the hat at the designated spawn position
|
||||
@@ -47,5 +51,6 @@ public class HatRespawn : MonoBehaviour
|
||||
transform.rotation = Quaternion.identity;
|
||||
lastInteractionTime = Time.time; // Reset the timer after respawning
|
||||
isDropped = false;
|
||||
Debug.Log("Hat respawned at designated position.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user