Ingredients go back to table after cooking

This commit is contained in:
2024-04-03 11:15:05 +02:00
parent 7c026e34ff
commit 2c4b6ec8ba
2 changed files with 4 additions and 9 deletions

View File

@@ -12,10 +12,10 @@ public class Ingredient : MonoBehaviour
public int NutritionalValue;
bool isMoving = false;
//public GameObject table;
private Transform DefaultTransform;
private Vector3 DefaultPosition;
void Start()
{
DefaultTransform = transform; //TODO pointer error
DefaultPosition = transform.position;
}
// Update is called once per frame
@@ -26,9 +26,6 @@ public class Ingredient : MonoBehaviour
Vector3 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
transform.position = new Vector3 (mousePosition.x, mousePosition.y, transform.position.z);
}
ResetPosition();
}
@@ -42,9 +39,6 @@ public class Ingredient : MonoBehaviour
public void ResetPosition()
{
transform.position = DefaultTransform.position;
Debug.Log(gameObject.name);
Debug.Log(transform.position);
Debug.Log(DefaultTransform.position);
transform.position = DefaultPosition;
}
}