I have an issue, whenever I try to click play in the Unity Editor, the Editor freezes. This might be caused by a script error. According to this post
http://answers.unity3d.com/questions/756762/unity-bug-not-responding-when-i-try-to-play.html
My Do/While script has a loop. Is there a way to fix it?
I am running Windows 10 x64 with Unity 5.3.5 (latest) version.
Here is the code that may have been causing the problem:
using UnityEngine;
public static class Helper
{
public static float ClampAngle(float angle, float min, float max)
{
do
{
if (angle < -360)
angle += 360;
if (angle > -360)
angle -= 360;
} while (angle < -360 || angle > 360);
return Mathf.Clamp (angle, min, max);
}
}
↧