SkinData FindSkinData(SkinDataType type) { SkinData found = SearchSkinData(type); /*if (found == null) * found = SearchSkinData2018dot3(type);*/ return(found); }
public SkinData(SkinDataType _skin, int _index) { skin = _skin; index = _index; }
static string GetSkinDataName(SkinDataType skin) { return(Enum.GetName(typeof(SkinDataType), skin)); }
SkinData SearchSkinData(SkinDataType type) { int[] aob = { 132, 192, (byte)type, 4, 51, 192, 94, 195, 139, 6, 94, 195 }; if (Environment.Is64BitOperatingSystem) { aob = new int[] { 132, 192, (byte)type, 8, 51, 192, 72, 131, 196, -1, 91, 195, 139, 3, 72, 131, 196, -1, 91, 195 } } ; // 2018.3 132, 192, 117, 8, 51, 192, 72, 131, 196, 48, 91, 195, 139, 3, 72, 131, 196, 48, 91, 195 };*/ // 2018.2 132, 192, 117, 8, 51, 192, 72, 131, 196, 32, 91, 195, 139, 3, 72, 131, 196, 32, 91, 195 SkinData found = null; int c = 0; for (int x = 0; x < appdata.Length; x++) { if (c >= aob.Length) { int i = x - aob.Length + 2; if (appdata[i] == aob[2]) { found = new SkinData(type, i); } break; } else { if (aob[c] == -1 || aob[c] == appdata[x]) { c++; } else { c = 0; } } } return(found); } void PatchFile(SkinDataType newType) { if (currentSkin != null) { var r = FindSkinData(currentSkin.skin); if (r != null) { appdata[r.index] = (byte)newType; File.WriteAllBytes(UnitySelected.file.FullName, appdata); LoadSkin(); MessageBox.Show("Write file successfuly.", "Patched!", MessageBoxButton.OK, MessageBoxImage.Information); } else { MessageBox.Show("There was an error writing the file.", "Error!", MessageBoxButton.OK, MessageBoxImage.Error); } } } bool moving = false; double movingX; double movingY;
SkinDataType GetInverseSkin(SkinDataType skin) { return(skin == SkinDataType.White ? SkinDataType.Black : SkinDataType.White); }