Ingredients go back to table after cooking
This commit is contained in:
@@ -1327,6 +1327,7 @@ MonoBehaviour:
|
||||
IngredientIn:
|
||||
- {fileID: 460072661}
|
||||
- {fileID: 1680633067}
|
||||
- {fileID: 449563471}
|
||||
NutritionalValue: 20
|
||||
--- !u!212 &885031696
|
||||
SpriteRenderer:
|
||||
|
||||
@@ -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
|
||||
@@ -27,9 +27,6 @@ public class Ingredient : MonoBehaviour
|
||||
transform.position = new Vector3 (mousePosition.x, mousePosition.y, transform.position.z);
|
||||
}
|
||||
|
||||
ResetPosition();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void OnMouseUp()
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user