ScriptableObjectFactory | Unity editor extension | Game Engine library

 by   liortal53 C# Version: Current License: No License

kandi X-RAY | ScriptableObjectFactory Summary

kandi X-RAY | ScriptableObjectFactory Summary

ScriptableObjectFactory is a C# library typically used in Gaming, Game Engine, Unity applications. ScriptableObjectFactory has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

A Unity editor extension for creating any ScriptableObject type. Download as a .UnityPackage: ScriptableObjectFactory. Originally introduced in this Blog Post.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              ScriptableObjectFactory has a low active ecosystem.
              It has 87 star(s) with 21 fork(s). There are 13 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              ScriptableObjectFactory has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of ScriptableObjectFactory is current.

            kandi-Quality Quality

              ScriptableObjectFactory has 0 bugs and 0 code smells.

            kandi-Security Security

              ScriptableObjectFactory has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              ScriptableObjectFactory code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              ScriptableObjectFactory does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              ScriptableObjectFactory releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ScriptableObjectFactory
            Get all kandi verified functions for this library.

            ScriptableObjectFactory Key Features

            No Key Features are available at this moment for ScriptableObjectFactory.

            ScriptableObjectFactory Examples and Code Snippets

            No Code Snippets are available at this moment for ScriptableObjectFactory.

            Community Discussions

            QUESTION

            Why are nested resources references in a ScriptableObject asset not loaded?
            Asked 2017-Jun-18 at 17:42

            Please read the entire question, and run the example before posting an answer.

            Overview

            I ran into some inconsistent behavior in Unity 5.6.1 when loading nested assets in a static Editor script (so in the static constructor of a class marked with [InitializeOnLoad]).

            I am loading a ScriptableObject Asset with Resources.Load, and the ScriptableObject has a public reference to another asset resource, let's suppose a GameObject Prefab. From this point I will refer to the ScriptableObject as the 'Wrapper', since in this simplified example that is the only purpose it serves.

            While Resources.Load correctly returns the Wrapper, the nested Prefab reference is often not yet loaded during the first run, but is loaded after the second run:

            To my understanding this is an order of execution issue where the Prefab resource in question has not been loaded yet during static construction, and on subsequent runs it remains cached.

            I assumed that when loading in an asset with a serialized reference to another asset, that the nested asset would automatically be loaded by default, regardless of whether this is during static init or not. This however does not seem to be the case here.

            Proof that the Wrapper asset does indeed correctly reference the Prefab in its serialized data (with Asset Serialization set to Force Text):

            I have also tried to use AssetDAtabase.LoadAssetAtPath (at least while in the editor), which has not made a difference.

            Example Project

            You can download a UnityPackage here, which contains the following:

            Or reproduce it as follows:

            • The Scripts:

              ExampleWrapper.cs:

              ...

            ANSWER

            Answered 2017-Jun-18 at 17:42

            There's a misconception regarding your question.

            The reference is passed to the Loader class, and you can check it by logging Wrapper.Value after scene initialization is completed.

            Most probably, the problem is (as you pointed out) in the execution/serialization order, apparently it happens something like this:

            • The Loader constructor is called, and Wrapper reference is passed correctly.
            • Debug.Log(Wrapper.Value) returns null because the fields of the scriptable object haven't yet been serialized
            • Wrapper's fields are serialized, now logging Wrapper.Value shows correctly ExampleObject.

            So, unless you're planning something "special" to do with the Wrapper fields during initalization, there's really not a problem in your code: I tried to run Debug.Log(Loader.Wrapper.Value) during the OnEnable of ExampleWrapper, and I got the correct value.

            Regarding your edit, apparently it happens "by Design", as clearly stated in this issue: https://issuetracker.unity3d.com/issues/unityeditor-dot-initializeonload-calls-the-constructor-twice-when-the-editor-opens

            Source https://stackoverflow.com/questions/44614848

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install ScriptableObjectFactory

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/liortal53/ScriptableObjectFactory.git

          • CLI

            gh repo clone liortal53/ScriptableObjectFactory

          • sshUrl

            git@github.com:liortal53/ScriptableObjectFactory.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link