Disabled Saves, moved Folders adn renamed Data files, and added a state machine to the cookie puzzle
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Distancemeasurer : MonoBehaviour
|
||||
{
|
||||
public float playerToPlaceDistance;
|
||||
public BirdEyesBehavior birdEyes;
|
||||
private Vector2 placePosition;
|
||||
private Vector2 playerPosition;
|
||||
private float distance;
|
||||
private GameObject player;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
placePosition = transform.position;
|
||||
player = GameObject.FindWithTag("Player");
|
||||
playerPosition = player.transform.position;
|
||||
distance = Vector2.Distance(placePosition, playerPosition);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
// TODO: Make this less expensive by not doing it every frame
|
||||
void Update()
|
||||
{
|
||||
playerPosition = player.transform.position;
|
||||
distance = Vector2.Distance(placePosition, playerPosition);
|
||||
//Logging.Debug("Distance to player: " + distance);
|
||||
if (distance > playerToPlaceDistance && birdEyes.correctItemIsIn == true)
|
||||
{
|
||||
birdEyes.BirdReveal();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user