Flipping the parallelogram when it is rotated on the z-axis at 45, 135, 225, or 315 degrees does not work properly.
Expected:
I have a fix but I need to do more testing. I'm not sure if it may or may not break solving a tangram puzzle.
//used for flip button
public void Flip(){
//rotate 180 on y axis
transform.Rotate (new Vector3 (0, 180, 0));
//when its flipped the direction is off by 1 unit for some reason, so we add one.
direction = (int)((this.transform.eulerAngles.z+1.0f) / 45);
//toggle flip variable
flipped = (flipped)?false:true;
}
Replace transform.Rotate (new Vector3 (0, 180, 0)); with the following that will flip the parallelogram horizontally without any rotations.
Flipping the parallelogram when it is rotated on the z-axis at 45, 135, 225, or 315 degrees does not work properly.
Expected:
I have a fix but I need to do more testing. I'm not sure if it may or may not break solving a tangram puzzle.
Replace
transform.Rotate (new Vector3 (0, 180, 0));
with the following that will flip the parallelogram horizontally without any rotations.