Loading game forever?

I added this:

        if (Distance < MeetDistance)
	{
		FollowerState = FollowOrIdle.Following;
	}
	if (Distance > SeparateDistance)
	{
		FollowerState = FollowOrIdle.Idle;
	}
	while (FollowerState == FollowOrIdle.Following)
	{

to make the code say this:

	if (Distance < MeetDistance)
	{
		FollowerState = FollowOrIdle.Following;
	}
	if (Distance > SeparateDistance)
	{
		FollowerState = FollowOrIdle.Idle;
	}
	while (FollowerState == FollowOrIdle.Following)
	{
	if (Leader.rigidbody2D.transform.position.x > rigidbody2D.transform.position.x + GeneralDistance)
	{
		rigidbody2D.transform.position += Vector3.right * Speed * Time.deltaTime;
	}
	if (Leader.rigidbody2D.transform.position.x < rigidbody2D.transform.position.x - GeneralDistance)
	{
		rigidbody2D.transform.position += Vector3.left * Speed * Time.deltaTime;
	}
	if (Leader.rigidbody2D.transform.position.y > rigidbody2D.transform.position.y + GeneralDistance)
	{
		rigidbody2D.transform.position += Vector3.up * Speed * Time.deltaTime;
	}
	if (Leader.rigidbody2D.transform.position.y < rigidbody2D.transform.position.y - GeneralDistance)
	{
		rigidbody2D.transform.position += Vector3.down * Speed * Time.deltaTime;
		}
	}
}

}

and now the game is loading forever. why?

Proper indentation would help make this readable and the problem more obvious. The issue is that you are do a while loop with this condition:

 FollowerState == FollowOrIdle.Following

…but nothing in the loop changes ‘FollowerState’, and you do not ‘yield’ in the loop, so control never goes anywhere else that could change ‘FollowerState’ to something besides ‘FollowOrIdle.Following’. So you cycle in the loop forever hanging Unity.

Please consider dedicating some time to purposefully learning the C# language. It is your ad-hoc approach to learning that is giving you so many problems.

Please bookmark this great resource for learning C# basics very quickly. It’s also a terrific reference: A C# Crash Course - RB Whitaker's Wiki

A while statement will execute until the condition becomes false. Since your while statement block never changes the state, it creates an infinite loop, causing Unity to hang.