private bool AlreadyAligned(Transform trans) { bool inPlace = (trans.position - grid.AlignVector3(trans.position, trans.lossyScale) + alignOffset).sqrMagnitude < 0.0001; bool rotated = rotateTransform ? Quaternion.Angle(gTrnsfrm.rotation, trans.rotation) < 0.0001 : true; return(inPlace && rotated); }
void OnDrawGizmos() { if (!debugPoints) { return; } Gizmos.color = Color.green; Gizmos.DrawSphere(point, 0.3f); // where the plyer is pointing at Gizmos.color = Color.red; Gizmos.DrawSphere(grid.AlignVector3(point, scale), 0.3f); // the aligned point }
private bool AlreadyAligned(Transform trans) { return((trans.position - grid.AlignVector3(trans.position, trans.lossyScale)).sqrMagnitude < 0.0001); }