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

@@ -22,8 +22,7 @@ namespace Cryville.Crtr.Skin.Components {
protected override unsafe void Execute() {
var keys = GetOperand(0).AsString();
var values = GetOperand(1);
int arrtype; int len;
values.GetArraySuffix(out arrtype, out len);
values.GetArraySuffix(out int arrtype, out int len);
if (arrtype != PdtInternalType.String) throw new InvalidCastException("Not an array of strings");
if (len != keys.Length) throw new ArgumentException("Length of key not equal to frame count");
var result = new Dictionary<char, SpriteInfo>(len);
@@ -49,7 +48,7 @@ namespace Cryville.Crtr.Skin.Components {
set { m_frames = value; UpdateFrames(); }
}
readonly TargetString m_value = new TargetString();
readonly TargetString m_value = new();
public TargetString Value { get { return m_value; } }
public float m_size;
@@ -103,10 +102,10 @@ namespace Cryville.Crtr.Skin.Components {
}
float sum_x;
readonly Dictionary<Texture2D, MeshWrapper> meshes = new Dictionary<Texture2D, MeshWrapper>();
readonly Dictionary<Texture2D, List<Vector3>> verts = new Dictionary<Texture2D, List<Vector3>>();
readonly Dictionary<Texture2D, List<Vector2>> uvs = new Dictionary<Texture2D, List<Vector2>>();
readonly Dictionary<Texture2D, List<int>> tris = new Dictionary<Texture2D, List<int>>();
readonly Dictionary<Texture2D, MeshWrapper> meshes = new();
readonly Dictionary<Texture2D, List<Vector3>> verts = new();
readonly Dictionary<Texture2D, List<Vector2>> uvs = new();
readonly Dictionary<Texture2D, List<int>> tris = new();
void UpdateMeshes() {
if (meshes.Count == 0) return;
sum_x = 0;
@@ -117,8 +116,7 @@ namespace Cryville.Crtr.Skin.Components {
tris[key].Clear();
}
foreach (var c in m_value) {
SpriteInfo f;
if (!m_frames.TryGetValue(c, out f)) {
if (!m_frames.TryGetValue(c, out SpriteInfo f)) {
Game.MainLogger.Log(3, "Skin", "Could not render the character '{0}' in the string \"{1}\" on the text component because no image is assigned to that character.", c, m_value);
continue;
}
@@ -173,7 +171,7 @@ namespace Cryville.Crtr.Skin.Components {
UpdateFrames();
mesh.Mesh.Clear();
UpdateScale();
Value.OnUpdate += UpdateScale;
Value.Updated += UpdateScale;
}
}
}