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

@@ -56,9 +56,9 @@ namespace Cryville.Common.Pdt {
while (ip != null) {
bool nextFlag = false;
var i = ip.Value;
if (i is PdtInstruction.Operate) {
if (i is PdtInstruction.Operate iop) {
int fc0 = _framecount;
int fc1 = ((PdtInstruction.Operate)i).Signature.ParamCount;
int fc1 = iop.Signature.ParamCount;
try { i.Execute(this, ref ip); } catch (Exception) { }
if (fc0 - _framecount == fc1) {
unsafe {
@@ -77,8 +77,7 @@ namespace Cryville.Common.Pdt {
}
}
}
else if (i is PdtInstruction.Collapse) {
var t = (PdtInstruction.Collapse)i;
else if (i is PdtInstruction.Collapse t) {
try {
var pins = ip;
i.Execute(this, ref ip);
@@ -133,15 +132,14 @@ namespace Cryville.Common.Pdt {
exp.IsConstant = true;
exp.IsPotentialConstant = true;
for (var ins = il.First; ins != null; ins = ins.Next) {
if (!(ins.Value is PdtInstruction.PushConstant)) {
if (ins.Value is not PdtInstruction.PushConstant) {
exp.IsConstant = false;
break;
}
}
}
void ReplaceIP(LinkedList<PdtInstruction> il, ref LinkedListNode<PdtInstruction> ip, PdtInstruction ins, Dictionary<LinkedListNode<PdtInstruction>, List<PdtInstruction.Collapse>> cols) {
List<PdtInstruction.Collapse> cins;
if (cols.TryGetValue(ip, out cins)) cols.Remove(ip);
if (cols.TryGetValue(ip, out List<PdtInstruction.Collapse> cins)) cols.Remove(ip);
ip = il.AddAfter(ip, ins);
il.Remove(ip.Previous);
if (cins != null) cols.Add(ip, cins);
@@ -163,8 +161,7 @@ namespace Cryville.Common.Pdt {
}
internal unsafe void PushVariable(int name, bool forced) {
fixed (StackFrame* frame = &_stack[_framecount++]) {
byte[] value;
GetVariable(name, forced, out frame->Type, out value);
GetVariable(name, forced, out frame->Type, out byte[] value);
frame->Offset = _goffset;
frame->Length = value.Length;
Array.Copy(value, 0, _mem, _goffset, value.Length);