refactor: Update Unity to 2022.3.62
This commit is contained in:
@@ -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"),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user