Hi everybody,
I’ve got a “containerList” that have 10 Lists with 45 items in it. The items are made from this class (which is serialized) :
using System;
using UnityEngine;
using System.Collections;
[Serializable]
public class SaveTalentClass {
[SerializeField]
public int talId;
public int talCurRank;
public int talMaxRank;
public SaveTalentClass(int id, int cRank, int mRank)
{
talId = id;
talCurRank = cRank;
talMaxRank = mRank;
}
public SaveTalentClass()
{
}
}
And I initialize my lists through a for loop like this :
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
using System.Linq;
[System.Serializable]
public class PlayerData : MonoBehaviour {
[SerializeField]
public List<List<SaveTalentClass>> containerList = new List<List<SaveTalentClass>>();
void Start ()
{
for(int i = 0; i < 10; i++)
{
containerList.Add (new List<SaveTalentClass>());
for(int j = 0; j < 45; j++)
{
containerList*.Add (new SaveTalentClass(j,0,0));*
-
}*
-
}*
- }*
But I can’t see my “containerList” in the inspector… I found this thread on a similar issue Serialize Nested Lists - Unity Answers but wasn’t able to adapt my script to make it work.
Can anyone be kind enough with a beginner and explain me how can I do ?