Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Why is my StartCoroutine within a IEnumerator bombing Unity? C#

$
0
0
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))); } }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>