The below code bombs Unity without an Error message straight to my OS. The offending line is the StartCoroutine within CheckMaximiseMenu IEnumerator.
Is this issue a lack of Co-routine knowledge or a legitimate bug ?
using UnityEngine;
using System.Collections;
public class GUIManager : MonoBehaviour {
void Start ()
{
StartCoroutine(CheckMaximiseMenu(new Rect(Screen.width - 10, 0, 10, Screen.height)));
}
IEnumerator CheckMaximiseMenu(Rect pRect)
{
while (!pRect.Contains(Input.mousePosition))
yield return 0;
StartCoroutine(CheckMinimiseMenu(new Rect(Screen.width - 50, 0, 50, Screen.height)));
}
IEnumerator CheckMinimiseMenu(Rect pRect)
{
while (!pRect.Contains(Input.mousePosition))
yield return 0;
StartCoroutine(CheckMaximiseMenu(new Rect(Screen.width - 10, 0, 10, Screen.height)));
}
}