Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by OmniverseProductions · Mar 24, 2012 at 09:34 PM · car-tutorialcar tutorial

Various obsolete warnings in cs and js scripts in unity car tutorial

As the title says, I'm getting obsolete warnings in the unity car tutorial. Here are the warnings.

C# Warnings

Assets/Scripts/CSharpScripts/BirdsBehaviour.cs(13,36): warning CS0618: UnityEngine.QualitySettings.currentLevel' is obsolete: Use GetQualityLevel and SetQualityLevel'

Assets/Scripts/CSharpScripts/BirdsBehaviour.cs(13,64): warning CS0618: UnityEngine.QualityLevel' is obsolete: See QualitySettings.names, QualitySettings.SetQualityLevel, and QualitySettings.GetQualityLevel'

Assets/Scripts/CSharpScripts/EffectController.cs(13,36): warning CS0618: UnityEngine.QualitySettings.currentLevel' is obsolete: Use GetQualityLevel and SetQualityLevel'

Assets/Scripts/CSharpScripts/EffectController.cs(13,64): warning CS0618: UnityEngine.QualityLevel' is obsolete: See QualitySettings.names, QualitySettings.SetQualityLevel, and QualitySettings.GetQualityLevel'

Javascript Warnings

Assets/Scripts/JavaScripts/FPSCounter.js(54,113): BCW0012: WARNING: 'UnityEngine.QualitySettings.currentLevel' is obsolete. Use GetQualityLevel and SetQualityLevel

Assets/Scripts/JavaScripts/PerformanceTweak.js(181,36): BCW0012: WARNING: 'UnityEngine.QualitySettings.currentLevel' is obsolete. Use GetQualityLevel and SetQualityLevel

Assets/Scripts/JavaScripts/PerformanceTweak.js(186,36): BCW0012: WARNING: 'UnityEngine.QualitySettings.currentLevel' is obsolete. Use GetQualityLevel and SetQualityLevel

Assets/Scripts/JavaScripts/PerformanceTweak.js(190,28): BCW0012: WARNING: 'UnityEngine.QualitySettings.currentLevel' is obsolete. Use GetQualityLevel and SetQualityLevel

Can someone help me fix these? I want to adapt this tutorial to my car racing game, but I feel I cannot adapt it fully if I'm getting these warnings. If someone could help me that would be great.

Edit: Here is more specific information. I know these warnings are a repeat. I just wanted to post them anyway, just in case.

Here is where the problem starts in BirdsBehaviour.cs

 void Start()
     {
         if(QualitySettings.currentLevel < QualityLevel.Good)
         {
             this.enabled = false;
             return;
         }
         birdTimer = Random.Range(2,5);
     }

Here is where the problem is happening in EffectController.cs

 void Update()
 {
     if(QualitySettings.currentLevel < QualityLevel.Good)
     {
         if (generate2dReflection)
             generate2dReflection.enabled = false;
         if (glowEffect)
             glowEffect.enabled = false;
         if (motionBlur)    
             motionBlur.enabled = false;
         if (colorCorrection)
             colorCorrection.enabled = false;
     }
     else
     {
         if (generate2dReflection)
             generate2dReflection.enabled = true;
         if (glowEffect)
             glowEffect.enabled = true;
         if (motionBlur)
             motionBlur.enabled = true;
         if (colorCorrection)
             colorCorrection.enabled = true;
     }
 }

Here is where the problem is happening in FPSCounter.js

 function OnGUI()
 {
     GUI.Box(new Rect(Screen.width-160, 10, 150, 40), fps.ToString("f2") + " | QSetting: " + QualitySettings.currentLevel);
 }

Here is where the problem is happening in PerformanceTweak.js

 {
         if(QualitySettings.currentLevel > QualityLevel.Fastest)
             QualitySettings.DecreaseLevel();
     }
     else if(fps > highFPS)
     {
         if(QualitySettings.currentLevel < QualityLevel.Fantastic)
             QualitySettings.IncreaseLevel();
     }
     
     if(QualitySettings.currentLevel < QualityLevel.Good)
Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bunny83 · Mar 24, 2012 at 09:40 PM 2
Share

Aaand?!...

The tutorial is kinda old so some things have changed in the API. The warnings even tell you exactly what you should use ins$$anonymous$$d. Do you even have a problem with the warnings? As long as there're no errors it's fine.

If you don't like the warnings, replace them with the new version like mentioned in the warning. You know the filename, the line number and the column number. You know which variable / property / function is obsolete and which one you should use ins$$anonymous$$d.

$$anonymous$$ost Unity users (like myself) don't even have this tutorial so what should we do...

avatar image OmniverseProductions · Mar 24, 2012 at 10:08 PM 0
Share

Please don't be rude. I don't appreciate it. I'm saying this because I need the help, and yes the warnings bug me. I wouldn't be posting in here otherwise. I'm also not going to ignore the warnings.

I should've posted in my original message that I've unsuccessfully tried fixing it, sorry about that. I'll update the question appropriately.

Edit: forgot to add that I'm still relatively new to program$$anonymous$$g.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Bunny83 · Mar 25, 2012 at 12:51 PM

The QualityLevel enum is obsolete.

 [Obsolete("See QualitySettings.names, QualitySettings.SetQualityLevel, and QualitySettings.GetQualityLevel")]
 public enum QualityLevel
 {
     Fastest,     // 0
     Fast,        // 1
     Simple,      // 2
     Good,        // 3
     Beautiful,   // 4
     Fantastic    // 5
 }

The obsolete warning says: "See QualitySettings.names, QualitySettings.SetQualityLevel, and QualitySettings.GetQualityLevel".

If the levels are still the same (maybe there will be different levels in the future), this line would be:

 if(QualitySettings.GetQualityLevel() < 3)
 // instead of
 if(QualitySettings.currentLevel < QualityLevel.Good)

The other occurrences should be no problems now.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How can i rotate my car steering wheel in accordance to the wheels? 1 Answer

Unity Car Tutorial how do i load into unity 1 Answer

What is the best way to modify the Car Tutorial for more cars? 2 Answers

Car Tutorial- Reverse gear issue!! 0 Answers

Car Demo Question 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges