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

@@ -40,8 +40,7 @@ namespace Cryville.Crtr.Skin {
throw new FormatException("Unknown error");
}
static Type GetComponentByName(string name) {
Type result;
if (BuiltinResources.Components.TryGetValue(name, out result)) return result;
if (BuiltinResources.Components.TryGetValue(name, out Type result)) return result;
throw new ArgumentException(string.Format("Component type \"{0}\" not found", name));
}
}
@@ -102,8 +101,7 @@ namespace Cryville.Crtr.Skin {
"Trying to set property \"{0}\" but the component is not found",
IdentifierManager.Shared.Retrieve(Name)
));
SkinProperty result;
if (!comp.Properties.TryGetValue(Name, out result))
if (!comp.Properties.TryGetValue(Name, out SkinProperty result))
throw new InvalidOperationException(string.Format(
"Property \"{0}\" not found on component",
IdentifierManager.Shared.Retrieve(Name)
@@ -186,15 +184,13 @@ namespace Cryville.Crtr.Skin {
}
public override bool IsValueRequired { get { return true; } }
public override void ExecuteStatic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp, IntKeyedDictionary<PropStores.Float> vars) {
PropStores.Float v;
if (!vars.TryGetValue(Name, out v))
if (!vars.TryGetValue(Name, out PropStores.Float v))
vars.Add(Name, v = new PropStores.Float());
if (!PdtEvaluator.Instance.Evaluate(v.Target, exp))
throw new EvaluationFailureException();
}
public override void ExecuteDynamic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp, IntKeyedDictionary<PropStores.Float> vars, int dl) {
PropStores.Float v;
if (!vars.TryGetValue(Name, out v))
if (!vars.TryGetValue(Name, out PropStores.Float v))
throw new InvalidOperationException(string.Format("Variable \"{0}\" not defined", IdentifierManager.Shared.Retrieve(Name)));
if (!PdtEvaluator.Instance.Evaluate(v.Target, exp))
throw new EvaluationFailureException();