food position fix
This commit is contained in:
@@ -12,9 +12,10 @@ public class Ingredient : MonoBehaviour
|
||||
public int NutritionalValue;
|
||||
bool isMoving = false;
|
||||
//public GameObject table;
|
||||
private Transform DefaultTransform;
|
||||
void Start()
|
||||
{
|
||||
|
||||
DefaultTransform = transform; //TODO pointer error
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
@@ -24,9 +25,10 @@ public class Ingredient : MonoBehaviour
|
||||
{
|
||||
Vector3 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
|
||||
transform.position = new Vector3 (mousePosition.x, mousePosition.y, transform.position.z);
|
||||
//Debug.Log(table.Bounds.Contains(mousePosition));
|
||||
}
|
||||
|
||||
ResetPosition();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -37,4 +39,12 @@ public class Ingredient : MonoBehaviour
|
||||
else
|
||||
isMoving = true;
|
||||
}
|
||||
|
||||
public void ResetPosition()
|
||||
{
|
||||
transform.position = DefaultTransform.position;
|
||||
Debug.Log(gameObject.name);
|
||||
Debug.Log(transform.position);
|
||||
Debug.Log(DefaultTransform.position);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user