Unity Project friert ein (OnPlayMode)
Vor einem Monat, funktionierte mein game noch. Dann fügte ich Musik im Menu hinzu und das spiel froher immer ein wenn ich die Scene ins spiel wechselte und die Coroutines startete. Ich habe jetzt schon Grafik, Sound, Garbage, Start Methode und Aysnc Scenen wechsel optimiert. Ich weiß nicht ob es an meinen loop Coroutines liegt, die ich als update Ersatz eingebaut habe. Dabei stopp ich sie immer wieder wenn ich eine bestimmte nicht mehr benötige! Code Beispiel:
private IEnumerator test;
void Start() { test = Test(0.5f); StartCoroutine(test); }
IEnumerator Test (float waitTime) { for( ; ;) { if(...) yield return new WaitForSeconds(waitTime); } }
//Nur ein Beispiel! void Update() { if(Input.GetKey(KeyCode.space)) { StopCoroutine(test); } }
Your answer
Follow this Question
Related Questions
Unity crashes when using while loop 0 Answers
While loop crashing all the time with breaks,While loop crashing constantly 0 Answers
Can someone explain what IEnumerators and for statements are? 1 Answer
Unity always freezes using this code, why? 3 Answers
Lookin for a windows Internet check 0 Answers