ReactUnity/core

Consider supporting 2023.2.0f1

xiaohai-huang opened this issue · 1 comments

The following 2 places cause compiler errors in 2023.2.0f1

Use of unassigned local variable altFont

Library\PackageCache\com.reactunity.core@0.16.3\Runtime\Types\FontReference.cs(94,64): error CS0165: Use of unassigned local variable 'altFont'

Font altFont;
#if REACT_TMP
var tmpFontAsset = base.Get<TMPro.TMP_FontAsset>(context, realType, realValue);
altFont = tmpFontAsset?.sourceFontFile;
#endif
#if REACT_TEXTCORE
var textCoreFontAsset = base.Get<UnityEngine.TextCore.Text.FontAsset>(context, realType, realValue);
altFont = textCoreFontAsset?.sourceFontFile ?? altFont;
#endif

FontSource does not contain a definition for TmpFontAsset

Library\PackageCache\com.reactunity.core@0.16.3\Runtime\Frameworks\UGUI\Components\TextComponent.cs(46,32): error CS1061: 'FontSource' does not contain a definition for 'TmpFontAsset' and no accessible extension method 'TmpFontAsset' accepting a first argument of type 'FontSource' could be found (are you missing a using directive or an assembly reference?)

font?.Get(Context, ft => {
if (font != value) return;
if (ft?.TmpFontAsset)
{
var asset = ft.TmpFontAsset;
Text.font = asset;
var style = ComputedStyle;
RecalculateFontStyleAndWeight(style.fontStyle, style.fontWeight, style.textTransform);
RecalculateLineHeight();
}
});

Seems like com.unity.textmeshpro package does not exist after 2023.2 and is built-in to the Unity. This was causing problems when detecting if the package is installed or not.

Fixed in 0.16.4

One weird difference between Unity 2023.2 and before is, scrollDelta from scroll events now return 120 times less value than before. Everybody upgrading should be aware of this if they use scrollDelta.