public bool Init(string levelFilename, ConvertSettings settings, Action <string> log, ConvertStats stats, List <object[]> cmds) { this.settings = settings; this.log = log; this.stats = stats; if (settings.defaultProbeRemove) { foreach (var cmd in cmds) { if ((VT)cmd[0] == VT.CmdGameObjectAddComponent && (string)cmd[3] == "ReflectionProbe") { RemoveObj.Add((Guid)cmd[1]); } } } if (settings.boxLavaNormalProbe) { foreach (var cmd in cmds) { if ((VT)cmd[0] == VT.CmdGetComponentAtRuntime) { compObj.Add((Guid)cmd[4], (Guid)cmd[3]); } else if ((VT)cmd[0] == VT.CmdGameObjectAddComponent) { compObj.Add((Guid)cmd[2], (Guid)cmd[1]); } else if ((VT)cmd[0] == VT.CmdGameObjectSetComponentProperty && (string)cmd[2] == "m_size" && cmd[5] is object[] val && (VT)val[0] == VT.Vector3b && compObj.TryGetValue((Guid)cmd[1], out Guid obj) && !objSize.ContainsKey(obj)) { objSize.Add(obj, new Vector3() { x = (float)val[1], y = (float)val[2], z = (float)val[3] }); } else if ((VT)cmd[0] == VT.CmdGameObjectSetComponentProperty && (string)cmd[2] == "m_repeat_delay" && cmd[5] is float val2 && compObj.TryGetValue((Guid)cmd[1], out Guid obj2) && !objRptDelay.ContainsKey(obj2)) { objRptDelay.Add(obj2, (int)val2); }
public bool Init(string levelFilename, ConvertSettings settings, Action <string> log, ConvertStats stats, List <object[]> cmds) { this.settings = settings; this.log = log; this.stats = stats; foreach (var cmd in cmds) { if ((VT)cmd[0] == VT.CmdMaterialSetTexture && (string)cmd[2] == "_MainTex") { texMatIds.Add((Guid)cmd[3], (Guid)cmd[1]); } } return(true); }
public bool Init(string levelFilename, ConvertSettings settings, Action <string> log, ConvertStats stats, List <object[]> cmds) { this.settings = settings; this.log = log; this.stats = stats; var compObj = new Dictionary <Guid, Guid>(); foreach (var cmd in cmds) { if ((VT)cmd[0] == VT.CmdGetComponentAtRuntime) { compObj.Add((Guid)cmd[4], (Guid)cmd[3]); } else if ((VT)cmd[0] == VT.CmdGameObjectSetComponentProperty && (string)cmd[2] == "m_index" && cmd[5] is int && compObj.TryGetValue((Guid)cmd[1], out Guid obj)) { objIdx.Add(obj, (int)cmd[5]); } } return(true); }