I updated my project yesterday and I'm not the best at scripting yet, but the upgrade caused me to get an error on line 29 (I added a comment there).
I am getting "Type Expected", and "Identifier Expected" both on the same line. But everywhere I look online it seems to be formatted correctly so I'm not sure.
This is the entire script btw.
using System.Collections;
using System.Runtime.CompilerServices;
using UnityEngine;
public class MusicPlayer : MonoBehaviour
{
public AudioClip[] tracks;
public float volume;
public float nextTrackDelay;
private AudioSource _source;
private Coroutine _nextTrackCoroutine;
private void Awake()
{
}
private void Start()
{
}
private void OnDestroy()
{
}
[IteratorStateMachine(typeof(<NextTrackWait>d__8))] //Errors Are Here
private IEnumerator NextTrackWait()
{
return null;
}
}
From .NET's documentation:
You shouldn't apply the IteratorStateMachine attribute to methods in your code. For methods in Visual Basic that have the Iterator modifier, the compiler will apply the IteratorStateMachine attribute in the IL that it emits.
You should remove that line entirely. My guess is something, somewhere, put decompiled code back into the source, where it shouldn't be. You don't need to add that attribute to your code, the compiler will put it for you where it needs to go.