Sunday, August 7, 2022
HomeGame DevelopmentViewing Wrapper/Container Courses from a Scriptable Object inside the Unity Inspector

Viewing Wrapper/Container Courses from a Scriptable Object inside the Unity Inspector


I am making a phrase sport to show children how you can learn and promote literacy. As a part of that, I made a Scriptable Object that is mainly a bunch of nested Lists, till it reaches the underside node:

utilizing System.Collections.Generic;
utilizing UnityEngine;
utilizing Unity.VisualScripting;
 
[CreateAssetMenu(fileName = "New WordPronunciationData", menuName = "Word Pronunciation Data", order = 51)]
 
public class WordPronunciationData : ScriptableObject
{
 
    [System.Serializable]
 
    [IncludeInSettings(true)]
        public class NeemUnitContainer {
        public Record<NeemUnit> NeemUnitContainers;
}
 
    [System.Serializable]
 
    [IncludeInSettings(true)]
        public class Syllable {
        public Record<NeemUnitContainer> Syllables;
}
 
    [System.Serializable]
 
    [IncludeInSettings(true)]
    public class NeemUnit {
        [SerializeField]
        public Record<FlexNeem> individualNeem;
         
    }
 
    [System.Serializable]
 
    [IncludeInSettings(true)]
    public class FlexNeem{
        [SerializeField]
        public NeemData superNeem;
     
        [SerializeField]
        public FeemData Feem;
 
    }
 
    [System.Serializable]
 
    [IncludeInSettings(true)]
    public class CompleteWordList{        
            public Record<Syllable> completeWord;
    }
    public Record<CompleteWordList> allWords;
 
}

It is working nice, and I can view and edit information within the Scriptable Objects completely.

enter image description here

However when I attempt to pull information from the Scriptable Object into Scene variables… I am unable to see them within the graph’s Inspector.

enter image description here

Nevertheless for the underside node in my Scriptable Object… I outlined the category as calling 2 different Scriptable Objects:

    [System.Serializable]
 
    [IncludeInSettings(true)]
    public class FlexNeem{
        [SerializeField]
        public NeemData superNeem;
     
        [SerializeField]
        public FeemData Feem;
 
    }

And once I create a variable and put information from these into them, they do present up very properly within the Inspector.

enter image description here

However someway once I make a container/wrapper class round this to make a Record, after which put that information right into a variable… it now not reveals up in a Inspector containing that variable.

enter image description here

That is making debugging a lot tougher. I can solely see what number of gadgets are within the record, not what the merchandise is.

Is that this simply the character of making so many wrapper/container lessons with lists? Is there a method I may view the wrapper/container lessons within the Inspector, reasonably than simply seeing “No Inspector For…”?

If anybody has ideas or recommendation, I might enormously recognize it! Thanks!!

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments