Follow

What is CS0618?

Symptoms

When trying to enter play mode, I am receiving the warning below:

warning CS0618: `___' is obsolete: `___'

Cause

The CS0618 warning is caused when you try to use an obsolete property or method.

The example below shows a script that uses the method "Application.LoadLevelAsync". This method is now obsolete and has been replaced with "SceneManager.LoadSceneAsync".

Errors displayed in this example:

warning CS0618: `UnityEngine.Application.LoadLevelAsync(string)' is 
obsolete: `Use SceneManager.LoadSceneAsync'

Resolution

To fix the CS0618 error you will need to use the new property/method that has replaced the obsolete property/method. You can see this when hovering over the obsolete property/method or within the error displayed in the console.

Here is the example script with the new fix:

More Information

https://msdn.microsoft.com/en-us/library/x5ye6x1e.aspx

 

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.