In one of my latest configuration projects found I needed to exclude the internal measurements of parts not aligned with a world axis. To do this I used the code below, however if you know of anything better please feel free to let me know.
1 2 3 4 5 6 |
Vector3 GOfwd= GO.transform.forward; if (Mathf.Approximately(Mathf.Abs((GOfwd.x+GOfwd.y+GOfwd.z)),1)) { //is aligned to a world axis } else { //is not aligned to a world axis } |
4184 Total Views 1 Views Today