public bool canYouPlaceBox(Vector2 post) { if (post.x == import.transform.position.x && post.y == import.transform.position.y) { return(false); } if (post.x == export.transform.position.x && post.y == export.transform.position.y) { if (currentExport == p.GetHolding()) { boxes.Remove(currentExport); et.removeTruck(); exportSlider.value = exportSlider.value - 20; currentExport.GetComponent <box>().StartCoroutine(currentExport.GetComponent <box>().exportBox()); currentExport = null; boxesExported++; return(true); } else { return(false); } } if (post.x < 0 || post.x > 11) { return(false); } if (post.y > 0 || post.y < -5) { return(false); } post = new Vector2(Mathf.Abs(post.x), Mathf.Abs(post.y)); if (grid[Mathf.RoundToInt(post.x), Mathf.RoundToInt(post.y)] == null) { grid[Mathf.RoundToInt(post.x), Mathf.RoundToInt(post.y)] = p.GetHolding(); return(true); } return(false); }