acdamiani / schema

Visual intelligence for the Unity game engine
https://schema-ai.com
MIT License
53 stars 4 forks source link

fix C# 8.0 syntax errors occurring in Unity 2020.3 #4

Closed zenvin-dev closed 10 months ago

zenvin-dev commented 10 months ago

After importing (a fork of) Schema into Unity 2020.3.26f1, I got several compiler errors.

Some were caused by target-typed new expressions, which were a new feature with C# 9.0. As far as I could find, (partial) C# 9.0 support was only introduced to Unity in the 2021 versions, so this wouldn't work in Unity 2020.1 (which the readme claims as the minimum version requirement for Schema to work).

The other errors were due to missing implicit conversions between T and T? in different cases.

Disclaimer: The included commit contains fixes for all the errors I was getting in Unity 2020.3.26f1. I have not checked the codebase for places that may cause other issues.

acdamiani commented 10 months ago

Looks good. Thanks for adding the UPM package manifest; I've been meaning to do that. I'll take a look and make sure everything checks out.