Ingredients go back to table after cooking
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user