Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
3
Question by AmazingDeveloper2 · May 18, 2019 at 12:12 PM · c#unity 5errorupdate problem

Missing the class attribute 'ExtensionOfNativeClass'

After updating unity to the version 2018.3.7f1 I have tihs error in my released project:

 'Saves' is missing the class attribute 'ExtensionOfNativeClass'!
 'SavesForAllSlots' is missing the class attribute 'ExtensionOfNativeClass'!
 'Saves' is missing the class attribute 'ExtensionOfNativeClass'!
 UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
 'SavesForAllSlots' is missing the class attribute 'ExtensionOfNativeClass'!
 UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
 ...

alt text

Why is tihs happening?

Saves.cs

 [System.Serializable]
 public class Saves
 {
     public string dateTime;
     public float transformPositionX;
     public float transformPositionY;
     public float transformPositionZ;
     public int latestSaveSlot;
     public int actNumber;
     public string sceneName;
     public int slotImage;
     public int currentActiveSlot;
     public int stepNumber;
 }

SavesForAllSlots.cs

 [System.Serializable]
 public class SavesForAllSlots
 {
     public int latestSaveSlotForAll;
 }

1.jpg (102.4 kB)
Comment
Add comment
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

4 Replies

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

Answer by snar1sburg · May 24, 2019 at 11:35 PM

@dmitry-kozyr this was happening to me earlier today. What was happening is that I changed a script from inheriting MonoBehaviour to being a static class. After doing this I started to get errors. Turns out the original prefab object that was in my screen was still referencing this MonoBehaviour script. So I went to my prefab, deleted the script from it and it fixed these errors. I believe that static scripts don't need to be attached to GameObjects. If this doesn't work I am not sure what is wrong, I am also not an expert just an avid learner!

Comment
Add comment · Show 1 · 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
avatar image Diogyn · Apr 06, 2020 at 04:23 PM 0
Share

In order to have a script as a component, it has to inherit $$anonymous$$onoBehavior. But just like you, the prefab was still having the script as a component while I had removed it in the gameObject in the scene. It sounds more like a bug from Unity, even if, in the end, it's probably cleaner to force us to remove it from the Prefab (a more explicit error would be helpful) It also happens with non-static classes

avatar image
1

Answer by MrBalin · Jan 20, 2021 at 02:58 AM

PFF Wouldn't you know it, all I did was restart Unity and the error went away. No deleting neccesary.

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
avatar image
0

Answer by Tosineben · Dec 10, 2019 at 08:42 PM

You have to create your save script in the script editor be it rider or android studio then copy input all the Data’s you want to save int it. After that you can add serializable to the class. Make sure you don’t create the class in unity or else it will create an inheritance of mono behavior with it.

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
avatar image
0

Answer by JesterGameCraft · Dec 18, 2021 at 10:54 PM

In my case I had a script that was added as a component to a Transform. I later changed this script from MonoBehaviour to just a generic class. I started to see the errors.

The solution was to remove the dead reference to the script in the GameObject that was referencing it. I just did a search in the Hierarchy using the offending script/class name and found the missing reference. Once removed, the errors were gone.

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

274 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

I am trying to offset camera x distance from player all the time. Even if the player moves. 1 Answer

NullReferenceException on Invoke in another class 1 Answer

tengo un problema con este script no puedo hacer que salte el personaje en un 2f,hi i have a problem making my chacter jump with this script 0 Answers

Time.deltatime not working. 1 Answer

error CS0201 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