bossList = new List(); public OneBossInfo[] one;}[System.Serializable]public c_unity scriptableobj">
当前位置:   article > 正文

unity ScriptableObject里面怎么序列化_unity scriptableobject none monoscript

unity scriptableobject none monoscript
[CreateAssetMenu(fileName = "NewBossList", menuName = "List/BossList")]

public class BossList : ScriptableObject
{
    public List<OneBossInfo> bossList = new List<OneBossInfo>();
    public OneBossInfo[] one;
}

[System.Serializable]
public class OneBossInfo
{
    public int bossID;
    public string bossName;
    public Sprite bossSprite;
    public string[] equipNames;
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 如果想让OneBossInfo里面的变量在编辑器中显示出来,就要把OneBossInfo后面的Monobehavie去掉,并在上面加上[System.Serializable]
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/81972
推荐阅读
相关标签