Search Unity

[Released]Static Inspector

Discussion in 'Assets and Asset Store' started by YinXiaozhou, Dec 11, 2017.

  1. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    Static Inspector

    So this time, we got some small but handy tool.

    large.png

    Static Inspector is a tool for monitoring and modification static variables in Inspector. It is created for those who just want to see what the values of statics in Editor, or tired with writing global data initialization hard code in Awake().

    you can tweak static values in the scripts' inspector view just like prefab or SerializableScript.

    This plugin is designed to be as easy to integrate as possible. With simple import, you are ready to go.

    Try Demo
    Buy Now

    Screen Shoots.
    Inspect.png Serialization.png UnityStyle.png

    FAQ:
    1. When do these static members initialize? Is it safe to use static values in Awake/Start/OnLevelLoaded? SI initialize all the static values in Unity's very first initial callback RuntimeInitializeOnLoadMethod. It's before any MonoBehavior callbacks.On the other hand, if you happen to use RuntimeInitializeOnLoadMethod in your project, please make sure your RuntimeInitializeOnLoadMethod callback won't depend on the serialized static members.

    2. How's the performance?In runtime, SI initializes all the static members in RuntimeInitializeOnLoadMethod. So it's only a one-time cost depends on how much static data do you have. SI used FullSerializer(Thanks to Jacob) as serialization library which is fairly good. On the other hand, this also means SI will take some time to initialize(even it's pretty fast) when the app starts. So in practice, you should not use SI as an all-in-one meta database, but a small set of global parameters tweaking tool. For large data which deserve a vast table or database, you should init them in your loading screen asynchronously.

    3. Does it support Javascript and Boo?SI only shows static members of C# scripts in your Unity project. Any other languages nor native/managed libraries' static members are not supported.

    4. What kind of types does SI serialize? Why is my static member not showing?Basically, it supports all the types Unity support(If you are not sure about this please check out the Unity official doc) and shows same GUI controls of these types. There's one exception, SI does not support UnityEvent types. Because these events can only bind to in scene objects, it doesn't make sense to assign static members to in scene objects. Since a unity scene is not guaranteed to be loaded at the start of the game.

    5. Where does my static member data stored in the project? I can't find them.All the serialized data of static members are saved in scripts' meta files. So don't forget to submit your .meta files into your codebase. Especially, the data is stored in the 'userData' field of the meta, so if any of your or third party's editor scripts also uses this field of script's meta file, the SI won't be work as expected. I can't find any plugin doing this, but just be aware.

    6. What platform does SI support?In theory, it should work on all platforms of Unity. The plugin is tested on iOS/Android/UWP/PC/Mac/WebGL. Platforms like PS/Xbox/Wii U/Switch is untested since we don't have the access to the Devkits.

    7. What's the difference between the demo and the one sold in the Asset Store?The demo can't insert static member data into build packages. So you can test the full functionality in the Editor, but the static member data won't appear in your game. However, it's good enough for those who just want to use it as a static member debugger in the editor.
     

    Attached Files:

    Last edited: Jan 17, 2018
  2. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    So guys, this tool is currently in pending review. I will update the post once it's Approved.
     
  3. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    The plugin just released on assetstore!
     
  4. Pascal_NotVeryMoe

    Pascal_NotVeryMoe

    Joined:
    Sep 11, 2018
    Posts:
    6
    Hey, just came across this looking around and I had a couple quick questions.

    Are there any issue with updating other third party scripts that utilize public static variables (ie. old serialized values)?

    I can't seem to get it to work with ScriptableObject classes, is this expected?
    Or is it because I have a couple other classes (exception types, enums) in the same file?

    Does it handle static classes?
     
    Last edited: Dec 9, 2018
  5. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    For 3rd party scripts, no matter what they do for the script update, as they don't change the variable name, the value is there.

    SI should be able to work with ScriptObject classes as far as the static property type is supported and has SerializedField annotated or public. If you found anything that not follow this behavior please send us the the script file(Just the class and property part is needed). Multiple classes in same file should not has effect for the plugin.

    It does handle static classes.
     
    Pascal_NotVeryMoe likes this.
  6. xzaxzaazx

    xzaxzaazx

    Joined:
    Mar 18, 2019
    Posts:
    10
    Maybe this plugin can support Odin Serialize? Some class like Dictionary can't be serialized.