Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[RELEASED] Datablocks - Revolutionary game data manager

Discussion in 'Assets and Asset Store' started by Bigpete591, Apr 24, 2015.

  1. Bigpete591

    Bigpete591

    Joined:
    May 7, 2013
    Posts:
    60
    Sure! Submit a pull request and I'll pull it in.
     
  2. PiotrW

    PiotrW

    Joined:
    Nov 2, 2014
    Posts:
    20
    Is this plugin working for you? For me it stopped loading data completely. With unity 5.6.1 data is not loaded from files and when I'm trying to debug it line by line in Visual Studio it is crashing my editor (. Worse is I do not have any errors at all in console, even nothing in crash log to find a solution
     
  3. Xelnath

    Xelnath

    Joined:
    Jan 31, 2015
    Posts:
    400
    Yes, it is working, but it's become a bit strange:

    Inheritance doesn't seem to work any longer and I have to Save Project to get the .asset files to update.
     
  4. Xelnath

    Xelnath

    Joined:
    Jan 31, 2015
    Posts:
    400
    Where do i do that :)
     
  5. PiotrW

    PiotrW

    Joined:
    Nov 2, 2014
    Posts:
    20
    Hmmm I got another strange behavior. In build or play mode datablock is not loading at all when class is [Serializable] and fields variables inside has [SerializeField]
     
  6. Xelnath

    Xelnath

    Joined:
    Jan 31, 2015
    Posts:
    400
    You shouldn't need to make your Datablocks serializable - they already exist as objects that exists and update via the ScriptableObject system
     
  7. PiotrW

    PiotrW

    Joined:
    Nov 2, 2014
    Posts:
    20
    Good to know Xelnath. Thanks for explanation.
     
  8. Xelnath

    Xelnath

    Joined:
    Jan 31, 2015
    Posts:
    400
    Known Issue:

    If you have the Datablock Importer open when you start the game, your Datablock manager will get wiped out, losing all of its blocks.

    Doing the following can fix that:

    DatablockExporter.cs
    Code (CSharp):
    1.         protected virtual void OnEnable()
    2.         {
    3.             // ABRAZIE: 5/30/17 - commented out because they were causing datablocks loaded in the
    4.             // Editor to be unloaded.
    5.             //if( Application.isPlaying == false && Application.isFocused )
    6.             //    DatablockManager.Instance.RefreshAssets();
    7.         }
    8.  
    Alternatively:

    DatablockManager.cs
    Code (CSharp):
    1.  
    2.         private void Awake()
    3.         {
    4.             // If there is already a DatablockManager, destroy this one
    5.             if (instance)
    6.             {
    7.                 if ( instance.datablocks.Count == 0 )
    8.                 {
    9.                     Destroy(instance);
    10.                     instance = this;
    11.                 }
    12.                 else
    13.                 {
    14.                     enabled = false;
    15.                     Destroy(gameObject);
    16.                     return;
    17.                 }
    18.             }
    19.  
     
    slimshader likes this.
  9. slimshader

    slimshader

    Joined:
    Jun 11, 2013
    Posts:
    185
    A PR maybe?
     
  10. Xelnath

    Xelnath

    Joined:
    Jan 31, 2015
    Posts:
    400
    Where??
     
  11. slimshader

    slimshader

    Joined:
    Jun 11, 2013
    Posts:
    185
  12. Xelnath

    Xelnath

    Joined:
    Jan 31, 2015
    Posts:
    400
    Rusted_Games likes this.
  13. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    120
    This asset is by far the best asset ive used to date for object data management and creation.
    It still works for me in unity 2017.1 and .2 beta with no modification to the existing github version linked earlier.
    The only problem ive noticed is that filtering an objects visible fields with an array doesn't seem to produce the correct results outside of the default project for some reason.
    @Bigpete591 - thank you for releasing it to the community to improve - you sir are a scholar and a ninja coder.
    @UnicornForest - wheres that github branch of ingenuity ?
     
  14. ConjuringTheFuture

    ConjuringTheFuture

    Joined:
    Feb 19, 2014
    Posts:
    19
    Oh wow I didn't realize this project got open sourced! That's awesome @Bigpete591

    Sorry guys, I won't be submitting a pull request for the changes I made back in 2015.

    I don't want to high jack this thread and spam it with links or anything, but I've been working on a new competing data management framework from scratch and plan on releasing it on the asset store later this year.

    If you are interested, pm me, don't ask about it in this thread.
     
  15. Strail

    Strail

    Joined:
    Sep 20, 2014
    Posts:
    2
    Just Love this!! Got this working with playmaker and it works very well. Thanks and big thimbs up @Bigpete591. Its a shame no further dev is being done on it, but even so, its more than useable in the current version.
     
    Rusted_Games likes this.