-
We recently switched from using the Unity Localization package to our own custom-built localization solution. However, we really liked SmartFormat, and we'd like to keep using it. Right now, we're just keeping the Unity Localization package installed purely for SmartFormat, but I'd love to remove it and add a separate SmartFormat package. Other C# libraries achieve this by creating a UPM package (example: ink-Unity integration), but it looks like this isn't available for SmartFormat (aside from this one, which is unofficial and very out of date). Is there an alternative method you'd recommend for pulling SmartFormat into a Unity project? If not, would you consider creating an official SmartFormat UPM package? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 2 replies
-
Hi, and thanks for falling in love with |
Beta Was this translation helpful? Give feedback.
-
This would be nice. However v3 uses some features only available in c# 9 and c# 10, which are not currently supported in Unity. Even version 2.7.2 generates warnings because Unity does not support nullable reference out of box. And it generates 1 error due to JsonSource which Unity does not recognize |
Beta Was this translation helpful? Give feedback.
-
After compiling the current SmartFormat core release with the C# 8 compiler, it looks like the features causing compiler errors are:
Since v2021.2 Unity is using C# 9 isn't it. Which Unity version are you aiming at? |
Beta Was this translation helpful? Give feedback.
-
I am using Unity 2022.3 and you are right after closer look, the 171 errors about unsupported features are all the same - unsupported file scoped namespaces. However:
So I think it's doable with some little work. Maybe a Unity branch or fork? |
Beta Was this translation helpful? Give feedback.
-
That's correct and is caused by
Simply install the the core NuGet package https://www.nuget.org/packages/SmartFormat/
That's too general to comment. |
Beta Was this translation helpful? Give feedback.
-
Unity does not support NuGet packages, and if it did, how would that help with that problem? Btw, I am commenting here because I like the idea of SmartFormat being upm package or at least Unity-ready (and of course I like SmartFormat), not because I need help to port it myself. I don't use it at the moment, but tried to port it and it's fairly easy. |
Beta Was this translation helpful? Give feedback.
The localization package version does have several changes made to support Unity(serialization) and the .Net version. I do have plans to try and integrate it closer into the Unity editor, maybe as a module however there's nothing concrete at the moment. You could just drag the Smart format folder out of the localization package, you may need to make a few small changes to remove some references to the localization package.
Why did you decide to switch to your own localization solution?