unity version 2022.3.11f1 Crash when import example of HeroSheet.cs
Hello. I import package, and copy paste the code of https://github.com/cathei/BakingSheet/blob/master/UnityProject/Assets/Samples/001%20-%20Define%20Sheet%20Container/HeroSheet.cs.
And when i clone from gg sheet, Unity being Crash, Another DataType is still good. But HeroSheet does not work. Note:
- Of cource at GG sheet side, my csv is copied by the same example.
- i not yet test on another Unity version.
Thanks for reporting. I couldn't reproduce this locally. If you can please share the reproducible project so I can look into it.
i tested again on unity 2022.3.8 and still being Crash. Here is my c# code
public class HeroSheet : Sheet<HeroSheet.Row>
{
public class Row : SheetRowArray<Elem>
{
public string Name { get; private set; }
public int Strength { get; private set; }
public int Inteligence { get; private set; }
public int Vitality { get; private set; }
public Elem GetLevel(int level)
{
// Level 1 would be index 0
return this[level - 1];
}
// Max level would be count of elements
public int MaxLevel => Count;
}
public class Elem : SheetRowElem
{
public float StatMultiplier { get; private set; }
public int RequiredExp { get; private set; }
public string RequiredMaterial { get; private set; }
}
}
public class TestSheetRuntime: SheetContainerBase
{
public TestSheetRuntime(Microsoft.Extensions.Logging.ILogger logger) : base(logger) {}
public HeroSheet HeroSheet { get; private set; }
}
public class TestGGSheetUI : MonoBehaviour
{
[SerializeField] private TextMeshProUGUI logTxt;
[SerializeField] private string sheetId;
[SerializeField] private TextAsset credential;
[Button]
async void Pull()
{
TestSheetRuntime test = new( new UnityLogger());
var googleConverter = new GoogleSheetConverter(sheetId, credential.text);
await test.Bake(googleConverter);
logTxt.text = test.HeroSheet[0].Name;
}
}
Bit late to reply, but your sheet appear ill-formed, as numbers (that should be in StatMultiplier) are invading Id column, and so on. I've tested with the given sample but it doesn't seem to cause crash. Let me know if you have different concerns or more info. Thank you!