All I want to do is make a simple block placement validator which is impossible when Unities location accuracy is almost as bad as their answer/forums community.
Additionally, here is some very odd behavior.
 public static void SectionPlaced(GameObject mazeTile)
{
SectionValidation[] children;
children = mazeTile.GetComponentsInChildren<SectionValidation>();
foreach (SectionValidation sectionValidation in children)
{
if (instance.placedSections.Contains(sectionValidation.gameObject.transform.position))
{
Debug.LogError("placed two sections in same spot");
}
else
{
Vector3 a = sectionValidation.gameObject.transform.position;
Vector3 b = new Vector3(Mathf.Floor(a.x), 0, Mathf.Floor(a.z));
//this is the gameobject
sectionValidation.gameObject.transform.position = b;
instance.placedSections.Add(sectionValidation.gameObject.transform.position);
Debug.Log(sectionValidation.gameObject.transform.position);
}
}
EventManager.TriggerEvent("OnPlaceTile");
}