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
0
Question by Da_B · Jul 14, 2017 at 02:12 PM · databaseassetdatabasedata storagedirty

Asset database creation problem

Hi there,

I've been running into a strange problem which I can't seem to get around. I'm not sure how to explain it clearly but i'll try.

I'm trying to create an asset database which stores data about some 'achievements' in my game. I've already dealt with unity's CreateAssets to build databases once or twice in unity 5.4. This time i'm working on an older project using unity 5.1.

The way I'm doing it is I believe pretty standard : I have an Achievement class :


public class Achievement {

 public string _name;
 public string _description;
 public level _level;
 public bool _get;
 public AnimationClip _anim;

 public Achievement () {
     _name = "default"+count;
     _description = "no description";
     _level = level.None;
     _get = false;
 }

}


an AchievementLibrary class :


public class AchievementLibrary : ScriptableObject {

 public List<Achievement> _achievements = new List<Achievement>();

}


, and a custom editor in an AchievementEditor class. I'm not putting all classes code in detail right now since it does'nt seem like my problem comes from the code. I'll put more if it's needed.

The problem in itself is : when i use my custom editor to create the asset database (same with CreateAssetMenu), the file gets created, but when looking the database file in the inspector, where it should be referencing the AchievementLibrary class (or type ? can't really tell the diference) it says : none (Mono Script). A picture might be clearer but i don't know how to insert one.

Then it gets wierder : Even though the database says it's missing a script, it works fine. There's no error in the console, still none if i open my custom editor window and i can add, remove and edit elements in the database as would seem normal.

If I manually add the corresponding AchievementLibrary script to the database, it takes it in and a warning label says : The associated script can not be loaded. Please fix any compile errors and assign a valid script. But of course, i don't have any compile errors, and if I edit the script by, say, adding or removing useless spaces and save, the warning disapears.

If I then open my custom editor again, the file gets reset (or rather the code fails to load the existing one and overwrites it with a new one). If I leave the application and restart, the same happens, yet I did place EditorUtility.SetDirty() in supposedly the correct places (and, from my research, set dirty should still work in 5.1).

I don't know if it's a bug or what, but I don't get any of it and my database is useless if I can't save it. So if anyone had an explanation and|or a solution to make it work I'd apreciate it quite a lot.

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

0 Replies

· Add your reply
  • Sort: 

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

112 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

Related Questions

Get Other Players information (those who are installed) ? 0 Answers

Best DataBase for mobile games 2 Answers

Redis in Unity 1 Answer

MMORPG Multiplayer | How to create Character Selection. 0 Answers

How do I set a query value from firestore to a text field? 0 Answers


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