Add support for exporting prop, compatible with the new version, add the EnableRootMotion option (#143)

* update BillboardBuilder

* add a new enum value

* Add the EnableRootMotion option to support scenarios where the character is not within the camera view

* Add support for exporting prop

* update

* compatible with the new version 2

* update

---------

Co-authored-by: 左右看 <1918891542@qq.com>
This commit is contained in:
CroakFang
2025-09-28 18:10:18 +08:00
committed by GitHub
parent 2f2f06eadc
commit d66991c2ef
33 changed files with 6620 additions and 390 deletions
+89 -2
View File
@@ -1,6 +1,8 @@
using System;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using UnityEngine;
public class Config
@@ -9,6 +11,15 @@ public class Config
public static Config Instance;
public string Version = "";
public string DBBaseKeyTip = "Base key to read game database files";
public string DBBaseKeyText;
public string DBKeyTip = "Key to read game database files";
public string DBKeyText;
public string ABKeyTip = "Key to read asset bundles";
public string ABKeyText;
public string LanguageTip = "Affects Uma names on the list. Language options: 0 - En, 1 - Jp";
public Language Language = Language.En;
@@ -94,6 +105,29 @@ public class Config
new MorphConvertConfig("口横狭い", new string[] { "Mouth_55_0" })
};
[NonSerialized]
public byte[] DBBaseKey = new byte[]
{
0xF1, 0x70, 0xCE, 0xA4, 0xDF, 0xCE, 0xA3, 0xE1,
0xA5, 0xD8, 0xC7, 0x0B, 0xD1, 0x00, 0x00, 0x00
};
[NonSerialized]
public byte[] DBKey = new byte[]
{
0x6D, 0x5B, 0x65, 0x33, 0x63, 0x36,
0x63, 0x25, 0x54, 0x71, 0x2D, 0x73,
0x50, 0x53, 0x63, 0x38, 0x6D, 0x34,
0x37, 0x7B, 0x35, 0x63, 0x70, 0x23,
0x37, 0x34, 0x53, 0x29, 0x73, 0x43,
0x36, 0x33
};
[NonSerialized]
public byte[] ABKey = new byte[]
{
0x53, 0x2B, 0x46, 0x31, 0xE4, 0xA7, 0xB9, 0x47, 0x3E, 0x7C, 0xFB
};
public Config()
{
@@ -111,6 +145,9 @@ public class Config
if (!File.Exists(configPath))
{
DBBaseKeyText = ByteArrayToHex(DBBaseKey);
DBKeyText = ByteArrayToHex(DBKey);
ABKeyText = ByteArrayToHex(ABKey);
File.WriteAllText(configPath, JsonUtility.ToJson(this, true));
}
else
@@ -118,6 +155,31 @@ public class Config
try
{
JsonUtility.FromJsonOverwrite(File.ReadAllText(configPath), this);
if (string.IsNullOrEmpty(DBBaseKeyText))
{
DBBaseKeyText = ByteArrayToHex(DBBaseKey);
}
else
{
DBBaseKey = HexToByteArray(DBBaseKeyText);
}
if (string.IsNullOrEmpty(DBKeyText))
{
DBKeyText = ByteArrayToHex(DBKey);
}
else
{
DBKey = HexToByteArray(DBKeyText);
}
if (string.IsNullOrEmpty(ABKeyText))
{
ABKeyText = ByteArrayToHex(ABKey);
}
else
{
ABKey = HexToByteArray(ABKeyText);
}
File.WriteAllText(configPath, JsonUtility.ToJson(this, true));
}
catch (Exception ex)
@@ -126,7 +188,6 @@ public class Config
MainPath = $@"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "Low"}\Cygames\umamusume";
}
}
Instance = this;
}
@@ -138,6 +199,32 @@ public class Config
UmaViewerUI.Instance.ShowMessage("The configuration has changed. Please restart the application.", UIMessageType.Default);
}
}
private string ByteArrayToHex(byte[] byteArray)
{
if (byteArray == null) return string.Empty;
StringBuilder sb = new StringBuilder(byteArray.Length * 2);
foreach (byte b in byteArray)
{
sb.AppendFormat("{0:X2}", b);
}
return sb.ToString();
}
private byte[] HexToByteArray(string hex)
{
if (string.IsNullOrEmpty(hex) || hex.Length % 2 != 0)
return new byte[0];
byte[] result = new byte[hex.Length / 2];
for (int i = 0; i < result.Length; i++)
{
string byteString = hex.Substring(i * 2, 2);
result[i] = byte.Parse(byteString, System.Globalization.NumberStyles.HexNumber);
}
return result;
}
}
public enum Language