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

@@ -1327,6 +1327,7 @@ MonoBehaviour:
IngredientIn: IngredientIn:
- {fileID: 460072661} - {fileID: 460072661}
- {fileID: 1680633067} - {fileID: 1680633067}
- {fileID: 449563471}
NutritionalValue: 20 NutritionalValue: 20
--- !u!212 &885031696 --- !u!212 &885031696
SpriteRenderer: SpriteRenderer:

View File

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