refactor: Update Unity to 2022.3.62

This commit is contained in:
2025-06-21 01:22:02 +08:00
parent d71bf7d4a5
commit 283783954f
112 changed files with 778 additions and 907 deletions

View File

@@ -45,7 +45,7 @@ namespace Cryville.Crtr.Skin.Components {
}
else Frame = null;
if (_mat != null) {
_mat.mainTexture = Frame == null ? null : Frame.Texture;
_mat.mainTexture = Frame?.Texture;
}
}
public static bool IsNullOrEmpty(SpriteInfo sprite) {
@@ -88,7 +88,7 @@ namespace Cryville.Crtr.Skin.Components {
OnFrameUpdate();
}
}
SpriteInfo[] m_frames = new SpriteInfo[] { new SpriteInfo() };
SpriteInfo[] m_frames = new SpriteInfo[] { new() };
public string[] Frames {
set {
m_frames = new SpriteInfo[value.Length];
@@ -169,12 +169,12 @@ namespace Cryville.Crtr.Skin.Components {
protected override Vector3 BaseScale {
get {
switch (m_fit) {
case FitMode.none: return Vector3.one;
case FitMode.width: return new Vector3(1, 1, 1 / CurrentFrame.Ratio);
case FitMode.height: return new Vector3(CurrentFrame.Ratio, 1, 1);
default: throw new NotSupportedException("Unsupported fit mode");
}
return m_fit switch {
FitMode.none => Vector3.one,
FitMode.width => new Vector3(1, 1, 1 / CurrentFrame.Ratio),
FitMode.height => new Vector3(CurrentFrame.Ratio, 1, 1),
_ => throw new NotSupportedException("Unsupported fit mode"),
};
}
}