Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unity version 2022.3.11f1 Crash when import example of HeroSheet.cs #35

Open
hoangcuongzk1 opened this issue Nov 11, 2023 · 4 comments
Open

Comments

@hoangcuongzk1
Copy link

No description provided.

@hoangcuongzk1 hoangcuongzk1 changed the title unity Crash 2922.3.11f1 with example of HeroSheet.cs unity version 2022.3.11f1 Crash when import example of HeroSheet.cs Nov 11, 2023
@hoangcuongzk1
Copy link
Author

hoangcuongzk1 commented Nov 11, 2023

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.

@cathei
Copy link
Owner

cathei commented Nov 12, 2023

Thanks for reporting. I couldn't reproduce this locally.
If you can please share the reproducible project so I can look into it.

@hoangcuongzk1
Copy link
Author

hoangcuongzk1 commented Nov 14, 2023

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;
        }
    }

image

@cathei
Copy link
Owner

cathei commented Jun 18, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants