Merge branch 'master' of https://github.com/croakfang/UmaViewer
This commit is contained in:
@@ -1564,8 +1564,8 @@ RectTransform:
|
|||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: 0}
|
m_AnchorMax: {x: 1, y: 0}
|
||||||
m_AnchoredPosition: {x: 2.5, y: 10}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: -15, y: 20}
|
m_SizeDelta: {x: 0, y: 11}
|
||||||
m_Pivot: {x: 0.5, y: 0}
|
m_Pivot: {x: 0.5, y: 0}
|
||||||
--- !u!114 &68719414
|
--- !u!114 &68719414
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@@ -7273,8 +7273,8 @@ RectTransform:
|
|||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0.000030517578, y: 0}
|
||||||
m_SizeDelta: {x: -20, y: 0}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!1 &292348635
|
--- !u!1 &292348635
|
||||||
GameObject:
|
GameObject:
|
||||||
@@ -49647,8 +49647,8 @@ RectTransform:
|
|||||||
m_Father: {fileID: 68719413}
|
m_Father: {fileID: 68719413}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0.25}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: 0.75}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 0, y: 0}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
@@ -53807,8 +53807,8 @@ RectTransform:
|
|||||||
m_Father: {fileID: 68719413}
|
m_Father: {fileID: 68719413}
|
||||||
m_RootOrder: 1
|
m_RootOrder: 1
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0.25}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: 0.75}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 0, y: 0}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ public class ManifestDB
|
|||||||
isError = false;
|
isError = false;
|
||||||
this.callback = callback;
|
this.callback = callback;
|
||||||
callback?.Invoke("Checking Resource Version", UIMessageType.Default);
|
callback?.Invoke("Checking Resource Version", UIMessageType.Default);
|
||||||
|
yield return null;
|
||||||
yield return UpdateMetaDB();
|
yield return UpdateMetaDB();
|
||||||
yield return UpdateMasterDB();
|
yield return UpdateMasterDB();
|
||||||
callback?.Invoke(isError ? "Update aborted." : $"Done. Please restart the application.\n", isError ? UIMessageType.Error : UIMessageType.Success);
|
callback?.Invoke(isError ? "Update aborted." : $"Done. Please restart the application.\n", isError ? UIMessageType.Error : UIMessageType.Success);
|
||||||
@@ -70,6 +71,7 @@ public class ManifestDB
|
|||||||
{
|
{
|
||||||
string rootHash = null;
|
string rootHash = null;
|
||||||
callback?.Invoke("Getting resource version", UIMessageType.Default);
|
callback?.Invoke("Getting resource version", UIMessageType.Default);
|
||||||
|
yield return null;
|
||||||
yield return UmaViewerDownload.DownloadText("https://www.tracenacademy.com/api/MetaC/root", txt =>
|
yield return UmaViewerDownload.DownloadText("https://www.tracenacademy.com/api/MetaC/root", txt =>
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(txt)) return;
|
if (string.IsNullOrEmpty(txt)) return;
|
||||||
@@ -116,6 +118,7 @@ public class ManifestDB
|
|||||||
|
|
||||||
//Insert platform
|
//Insert platform
|
||||||
callback?.Invoke("Reading Platform Manifest", UIMessageType.Default);
|
callback?.Invoke("Reading Platform Manifest", UIMessageType.Default);
|
||||||
|
yield return null;
|
||||||
ManifestEntry[] platformEntrys = null;
|
ManifestEntry[] platformEntrys = null;
|
||||||
yield return GetManifest(rootEntry.hname, Kind.PlatformManifest, entrys => { platformEntrys = entrys; });
|
yield return GetManifest(rootEntry.hname, Kind.PlatformManifest, entrys => { platformEntrys = entrys; });
|
||||||
if (platformEntrys == null)
|
if (platformEntrys == null)
|
||||||
@@ -131,6 +134,7 @@ public class ManifestDB
|
|||||||
|
|
||||||
//Insert AssetManifest
|
//Insert AssetManifest
|
||||||
callback?.Invoke($"Reading Assets Manifest", UIMessageType.Default);
|
callback?.Invoke($"Reading Assets Manifest", UIMessageType.Default);
|
||||||
|
yield return null;
|
||||||
ManifestEntry[] assetEntrys = null;
|
ManifestEntry[] assetEntrys = null;
|
||||||
yield return GetManifest(platformEntry.hname, Kind.AssetManifest, entrys => { assetEntrys = entrys; });
|
yield return GetManifest(platformEntry.hname, Kind.AssetManifest, entrys => { assetEntrys = entrys; });
|
||||||
if (assetEntrys == null)
|
if (assetEntrys == null)
|
||||||
@@ -162,6 +166,7 @@ public class ManifestDB
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
callback?.Invoke($"Reading AssetBundles Manifest : {assetEntry.tname}", UIMessageType.Default);
|
callback?.Invoke($"Reading AssetBundles Manifest : {assetEntry.tname}", UIMessageType.Default);
|
||||||
|
yield return null;
|
||||||
using SqliteTransaction tran = MetaDB.BeginTransaction();
|
using SqliteTransaction tran = MetaDB.BeginTransaction();
|
||||||
for (int i = 0; i < assets.Length; i++)
|
for (int i = 0; i < assets.Length; i++)
|
||||||
{
|
{
|
||||||
@@ -185,16 +190,19 @@ public class ManifestDB
|
|||||||
var masterDir = Path.GetDirectoryName(masterPath);
|
var masterDir = Path.GetDirectoryName(masterPath);
|
||||||
|
|
||||||
callback?.Invoke($"Checking master.mdb", UIMessageType.Default);
|
callback?.Invoke($"Checking master.mdb", UIMessageType.Default);
|
||||||
|
yield return null;
|
||||||
SqliteCommand command = new SqliteCommand("SELECT h FROM a WHERE n LIKE 'master.mdb.lz4'", MetaDB);
|
SqliteCommand command = new SqliteCommand("SELECT h FROM a WHERE n LIKE 'master.mdb.lz4'", MetaDB);
|
||||||
var reader = command.ExecuteReader();
|
var reader = command.ExecuteReader();
|
||||||
|
|
||||||
if (reader.Read())
|
if (reader.Read())
|
||||||
{
|
{
|
||||||
|
yield return null;
|
||||||
var hash = reader.GetString(0);
|
var hash = reader.GetString(0);
|
||||||
var path = GetManifestPath(hash);
|
var path = GetManifestPath(hash);
|
||||||
if (!File.Exists(path))
|
if (!File.Exists(path))
|
||||||
{
|
{
|
||||||
callback?.Invoke($"Downloading master.mdb", UIMessageType.Default);
|
callback?.Invoke($"Downloading master.mdb", UIMessageType.Default);
|
||||||
|
yield return null;
|
||||||
UnityWebRequest www = UnityWebRequest.Get(UmaViewerDownload.GetGenericRequestUrl(hash));
|
UnityWebRequest www = UnityWebRequest.Get(UmaViewerDownload.GetGenericRequestUrl(hash));
|
||||||
yield return www.SendWebRequest();
|
yield return www.SendWebRequest();
|
||||||
if (www.result == UnityWebRequest.Result.Success)
|
if (www.result == UnityWebRequest.Result.Success)
|
||||||
@@ -211,6 +219,7 @@ public class ManifestDB
|
|||||||
}
|
}
|
||||||
|
|
||||||
callback?.Invoke($"Decompress master.mdb", UIMessageType.Default);
|
callback?.Invoke($"Decompress master.mdb", UIMessageType.Default);
|
||||||
|
yield return null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(masterDir);
|
Directory.CreateDirectory(masterDir);
|
||||||
@@ -283,10 +292,12 @@ public class ManifestDB
|
|||||||
if (!File.Exists(path))
|
if (!File.Exists(path))
|
||||||
{
|
{
|
||||||
this.callback?.Invoke($"Downloading Manifest :{hash}", UIMessageType.Default);
|
this.callback?.Invoke($"Downloading Manifest :{hash}", UIMessageType.Default);
|
||||||
|
yield return null;
|
||||||
yield return DownloadManifest(hash);
|
yield return DownloadManifest(hash);
|
||||||
}
|
}
|
||||||
if (File.Exists(path))
|
if (File.Exists(path))
|
||||||
{
|
{
|
||||||
|
yield return null;
|
||||||
callback.Invoke(GetManifest(path, true, kind));
|
callback.Invoke(GetManifest(path, true, kind));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class UmaAssetManager : MonoBehaviour
|
|||||||
|
|
||||||
public static event Action <UmaDatabaseEntry> OnLoadedBundleUpdate;
|
public static event Action <UmaDatabaseEntry> OnLoadedBundleUpdate;
|
||||||
public static event Action OnLoadedBundleClear;
|
public static event Action OnLoadedBundleClear;
|
||||||
public static event Action<int, int> OnLoadProgressChange;
|
public static event Action<int, int, string> OnLoadProgressChange;
|
||||||
|
|
||||||
public static Coroutine LoadCoroutine;
|
public static Coroutine LoadCoroutine;
|
||||||
|
|
||||||
@@ -47,45 +47,52 @@ public class UmaAssetManager : MonoBehaviour
|
|||||||
|
|
||||||
for(int i = 0; i < result.Count; i++)
|
for(int i = 0; i < result.Count; i++)
|
||||||
{
|
{
|
||||||
LoadAB(result[i]);
|
var exist = LoadAB(result[i]);
|
||||||
OnLoadProgressChange?.Invoke(i, result.Count);
|
if (!exist)
|
||||||
yield return null;
|
{
|
||||||
|
OnLoadProgressChange?.Invoke(i, result.Count, null);
|
||||||
|
yield return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OnLoadProgressChange?.Invoke(-1, result.Count);
|
OnLoadProgressChange?.Invoke(-1, result.Count, null);
|
||||||
LoadCoroutine = null;
|
LoadCoroutine = null;
|
||||||
OnDone?.Invoke();
|
OnDone?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AssetBundle LoadAssetBundle(UmaDatabaseEntry entry, bool neverUnload = false)
|
public static AssetBundle LoadAssetBundle(UmaDatabaseEntry entry, bool neverUnload = false, bool isRecursive = true)
|
||||||
{
|
{
|
||||||
if (Exist(entry)) return Get(entry);
|
if (Exist(entry)) return Get(entry);
|
||||||
var Main = UmaViewerMain.Instance;
|
if (isRecursive)
|
||||||
List<UmaDatabaseEntry> result = new List<UmaDatabaseEntry>();
|
|
||||||
SearchAB(Main, entry, ref result);
|
|
||||||
foreach(var e in result)
|
|
||||||
{
|
{
|
||||||
LoadAB(e, entry.Name.EndsWith("shader") || neverUnload);
|
var Main = UmaViewerMain.Instance;
|
||||||
|
List<UmaDatabaseEntry> result = new List<UmaDatabaseEntry>();
|
||||||
|
SearchAB(Main, entry, ref result);
|
||||||
|
foreach (var e in result)
|
||||||
|
{
|
||||||
|
LoadAB(e, neverUnload);
|
||||||
|
}
|
||||||
|
return Get(entry.Name);
|
||||||
}
|
}
|
||||||
return Get(entry.Name);
|
|
||||||
|
LoadAB(entry, neverUnload);
|
||||||
|
return Get(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void LoadAB(UmaDatabaseEntry entry, bool neverUnload = false)
|
private static bool LoadAB(UmaDatabaseEntry entry, bool neverUnload = false)
|
||||||
{
|
{
|
||||||
string filePath = entry.FilePath;
|
string filePath = entry.FilePath;
|
||||||
if (Exist(entry.Name))
|
if (Exist(entry.Name))
|
||||||
{
|
{
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
else if (File.Exists(filePath))
|
else if (File.Exists(filePath))
|
||||||
{
|
{
|
||||||
|
|
||||||
AssetBundle bundle = AssetBundle.LoadFromFile(filePath);
|
AssetBundle bundle = AssetBundle.LoadFromFile(filePath);
|
||||||
if (!bundle)
|
if (!bundle)
|
||||||
{
|
{
|
||||||
Debug.Log(filePath + " exists and doesn't work");
|
Debug.Log(filePath + " exists and doesn't work");
|
||||||
UmaViewerUI.Instance?.ShowMessage(filePath + " exists and doesn't work", UIMessageType.Error);
|
UmaViewerUI.Instance?.ShowMessage(filePath + " exists and doesn't work", UIMessageType.Error);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
AddOrUpdate(entry.Name, bundle, neverUnload);
|
AddOrUpdate(entry.Name, bundle, neverUnload);
|
||||||
if (!neverUnload)
|
if (!neverUnload)
|
||||||
@@ -98,6 +105,7 @@ public class UmaAssetManager : MonoBehaviour
|
|||||||
Debug.LogError($"{entry.Name} - {filePath} does not exist");
|
Debug.LogError($"{entry.Name} - {filePath} does not exist");
|
||||||
UmaViewerUI.Instance?.ShowMessage($"{entry.Name} - {filePath} does not exist", UIMessageType.Error);
|
UmaViewerUI.Instance?.ShowMessage($"{entry.Name} - {filePath} does not exist", UIMessageType.Error);
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SearchAB(UmaViewerMain Main, UmaDatabaseEntry entry,ref List<UmaDatabaseEntry> result)
|
private static void SearchAB(UmaViewerMain Main, UmaDatabaseEntry entry,ref List<UmaDatabaseEntry> result)
|
||||||
@@ -106,16 +114,7 @@ public class UmaAssetManager : MonoBehaviour
|
|||||||
{
|
{
|
||||||
foreach (string prerequisite in entry.Prerequisites.Split(';'))
|
foreach (string prerequisite in entry.Prerequisites.Split(';'))
|
||||||
{
|
{
|
||||||
if (prerequisite.StartsWith(UmaDatabaseController.CharaPath))
|
SearchAB(Main, Main.AbList[prerequisite], ref result);
|
||||||
{
|
|
||||||
SearchAB(Main , Main.AbChara.FirstOrDefault(ab => ab.Name == prerequisite),ref result);
|
|
||||||
}
|
|
||||||
else if (prerequisite.StartsWith(UmaDatabaseController.MotionPath))
|
|
||||||
{
|
|
||||||
SearchAB(Main, Main.AbMotions.FirstOrDefault(ab => ab.Name == prerequisite), ref result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
SearchAB(Main, Main.AbList.FirstOrDefault(ab => ab.Name == prerequisite), ref result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result.Add(entry);
|
result.Add(entry);
|
||||||
@@ -181,8 +180,10 @@ public class UmaAssetManager : MonoBehaviour
|
|||||||
var builder = UmaViewerBuilder.Instance;
|
var builder = UmaViewerBuilder.Instance;
|
||||||
if (builder)
|
if (builder)
|
||||||
{
|
{
|
||||||
if (builder.CurrentUMAContainer) Destroy(builder.CurrentUMAContainer);
|
if (builder.CurrentUMAContainer)
|
||||||
if (builder.CurrentOtherContainer) Destroy(builder.CurrentOtherContainer);
|
builder.UnloadUma();
|
||||||
|
if (builder.CurrentOtherContainer)
|
||||||
|
Destroy(builder.CurrentOtherContainer.gameObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -487,6 +487,7 @@ public class UmaContainer : MonoBehaviour
|
|||||||
|
|
||||||
BipedRagdollCreator.Create(r, options);
|
BipedRagdollCreator.Create(r, options);
|
||||||
PuppetMaster = PuppetMaster.SetUp(container.transform, 8, 9);
|
PuppetMaster = PuppetMaster.SetUp(container.transform, 8, 9);
|
||||||
|
PuppetMaster.solverIterationCount = 3;
|
||||||
PuppetMaster.FlattenHierarchy();
|
PuppetMaster.FlattenHierarchy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,12 +43,12 @@ public class UmaDatabaseController
|
|||||||
/// <summary> outgame/dress/ </summary>
|
/// <summary> outgame/dress/ </summary>
|
||||||
public static string CostumePath = "outgame/dress/";
|
public static string CostumePath = "outgame/dress/";
|
||||||
|
|
||||||
public IEnumerable<UmaDatabaseEntry> MetaEntries;
|
public Dictionary<string, UmaDatabaseEntry> MetaEntries;
|
||||||
public IEnumerable<DataRow> CharaData;
|
public List<DataRow> CharaData;
|
||||||
public IEnumerable<DataRow> MobCharaData;
|
public List<DataRow> MobCharaData;
|
||||||
public IEnumerable<FaceTypeData> FaceTypeData;
|
public List<FaceTypeData> FaceTypeData;
|
||||||
public IEnumerable<DataRow> LiveData;
|
public List<DataRow> LiveData;
|
||||||
public IEnumerable<DataRow> DressData;
|
public List<DataRow> DressData;
|
||||||
|
|
||||||
/// <summary> Meta Database Connection </summary>
|
/// <summary> Meta Database Connection </summary>
|
||||||
private SqliteConnection metaDb;
|
private SqliteConnection metaDb;
|
||||||
@@ -99,11 +99,12 @@ public class UmaDatabaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static IEnumerable<UmaDatabaseEntry> ReadMeta(SqliteConnection conn)
|
static Dictionary<string,UmaDatabaseEntry> ReadMeta(SqliteConnection conn)
|
||||||
{
|
{
|
||||||
SqliteCommand sqlite_cmd = conn.CreateCommand();
|
SqliteCommand sqlite_cmd = conn.CreateCommand();
|
||||||
sqlite_cmd.CommandText = "SELECT m,n,h,c,d FROM a";
|
sqlite_cmd.CommandText = "SELECT m,n,h,c,d FROM a";
|
||||||
SqliteDataReader sqlite_datareader = sqlite_cmd.ExecuteReader();
|
SqliteDataReader sqlite_datareader = sqlite_cmd.ExecuteReader();
|
||||||
|
Dictionary<string, UmaDatabaseEntry> meta = new Dictionary<string, UmaDatabaseEntry>();
|
||||||
while (sqlite_datareader.Read())
|
while (sqlite_datareader.Read())
|
||||||
{
|
{
|
||||||
UmaDatabaseEntry entry = null;
|
UmaDatabaseEntry entry = null;
|
||||||
@@ -111,32 +112,33 @@ public class UmaDatabaseController
|
|||||||
{
|
{
|
||||||
entry = new UmaDatabaseEntry()
|
entry = new UmaDatabaseEntry()
|
||||||
{
|
{
|
||||||
Type = (UmaFileType)Enum.Parse(typeof(UmaFileType), sqlite_datareader["m"] as String),
|
Type = (UmaFileType)Enum.Parse(typeof(UmaFileType), sqlite_datareader["m"] as string),
|
||||||
Name = sqlite_datareader["n"] as String,
|
Name = sqlite_datareader["n"] as string,
|
||||||
Url = sqlite_datareader["h"] as String,
|
Url = sqlite_datareader["h"] as string,
|
||||||
Checksum = sqlite_datareader["c"].ToString(),
|
Checksum = sqlite_datareader["c"].ToString(),
|
||||||
Prerequisites = sqlite_datareader["d"] as String
|
Prerequisites = sqlite_datareader["d"] as string
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
catch(Exception e) { Debug.LogError("Error caught: " + e); }
|
catch(Exception e) { Debug.LogError("Error caught: " + e); }
|
||||||
|
|
||||||
if (entry != null)
|
if (entry != null) meta.Add(entry.Name, entry);
|
||||||
yield return entry;
|
|
||||||
}
|
}
|
||||||
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
static IEnumerable<DataRow> ReadCharaMaster(SqliteConnection conn)
|
static List<DataRow> ReadCharaMaster(SqliteConnection conn)
|
||||||
{
|
{
|
||||||
return ReadMaster(conn, "SELECT * FROM chara_data C,(SELECT D.'index' charaid,D.'text' charaname FROM text_data D WHERE id like 6) T WHERE C.id like T.charaid");
|
return ReadMaster(conn, "SELECT * FROM chara_data C,(SELECT D.'index' charaid,D.'text' charaname FROM text_data D WHERE id like 6) T WHERE C.id like T.charaid");
|
||||||
}
|
}
|
||||||
|
|
||||||
static IEnumerable<DataRow> ReadMobCharaMaster(SqliteConnection conn)
|
static List<DataRow> ReadMobCharaMaster(SqliteConnection conn)
|
||||||
{
|
{
|
||||||
return ReadMaster(conn, "SELECT * FROM mob_data");
|
return ReadMaster(conn, "SELECT * FROM mob_data");
|
||||||
}
|
}
|
||||||
|
|
||||||
static IEnumerable<DataRow> ReadMaster(SqliteConnection conn,string sql)
|
static List<DataRow> ReadMaster(SqliteConnection conn,string sql)
|
||||||
{
|
{
|
||||||
|
List<DataRow> dr = new List<DataRow>();
|
||||||
SqliteCommand sqlite_cmd = conn.CreateCommand();
|
SqliteCommand sqlite_cmd = conn.CreateCommand();
|
||||||
sqlite_cmd.CommandText = sql;
|
sqlite_cmd.CommandText = sql;
|
||||||
SqliteDataReader sqlite_datareader = sqlite_cmd.ExecuteReader();
|
SqliteDataReader sqlite_datareader = sqlite_cmd.ExecuteReader();
|
||||||
@@ -145,13 +147,15 @@ public class UmaDatabaseController
|
|||||||
var temp = result.Rows.GetEnumerator();
|
var temp = result.Rows.GetEnumerator();
|
||||||
while (temp.MoveNext())
|
while (temp.MoveNext())
|
||||||
{
|
{
|
||||||
yield return (DataRow)temp.Current;
|
dr.Add((DataRow)temp.Current);
|
||||||
}
|
}
|
||||||
sqlite_cmd.Dispose();
|
sqlite_cmd.Dispose();
|
||||||
|
return dr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static IEnumerable<FaceTypeData> ReadFaceTypeData(SqliteConnection conn)
|
static List<FaceTypeData> ReadFaceTypeData(SqliteConnection conn)
|
||||||
{
|
{
|
||||||
|
List<FaceTypeData> data = new List<FaceTypeData>();
|
||||||
SqliteCommand sqlite_cmd = conn.CreateCommand();
|
SqliteCommand sqlite_cmd = conn.CreateCommand();
|
||||||
sqlite_cmd.CommandText = "SELECT * FROM face_type_data";
|
sqlite_cmd.CommandText = "SELECT * FROM face_type_data";
|
||||||
SqliteDataReader sqlite_datareader = sqlite_cmd.ExecuteReader();
|
SqliteDataReader sqlite_datareader = sqlite_cmd.ExecuteReader();
|
||||||
@@ -169,30 +173,28 @@ public class UmaDatabaseController
|
|||||||
inverce_face_type = sqlite_datareader.GetString(7),
|
inverce_face_type = sqlite_datareader.GetString(7),
|
||||||
set_face_group = sqlite_datareader.GetInt32(8),
|
set_face_group = sqlite_datareader.GetInt32(8),
|
||||||
};
|
};
|
||||||
yield return entry;
|
data.Add(entry);
|
||||||
}
|
}
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static IEnumerable<DataRow> ReadAllLiveData(SqliteConnection conn)
|
static List<DataRow> ReadAllLiveData(SqliteConnection conn)
|
||||||
{
|
{
|
||||||
return ReadMaster(conn, $"SELECT * FROM live_data L,(SELECT D.'index' songid,D.'text' songname FROM text_data D WHERE id like 16) T WHERE L.music_id like T.songid");
|
return ReadMaster(conn, $"SELECT * FROM live_data L,(SELECT D.'index' songid,D.'text' songname FROM text_data D WHERE id like 16) T WHERE L.music_id like T.songid");
|
||||||
}
|
}
|
||||||
|
|
||||||
static IEnumerable<DataRow> ReadAllDressData(SqliteConnection conn)
|
static List<DataRow> ReadAllDressData(SqliteConnection conn)
|
||||||
{
|
{
|
||||||
return ReadMaster(conn, $"SELECT * FROM dress_data C,(SELECT D.'index' dressid,D.'text' dressname FROM text_data D WHERE id like 14) T WHERE C.id like T.dressid");
|
return ReadMaster(conn, $"SELECT * FROM dress_data C,(SELECT D.'index' dressid,D.'text' dressname FROM text_data D WHERE id like 14) T WHERE C.id like T.dressid");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DataRow ReadCharaData(CharaEntry chara)
|
public static DataRow ReadCharaData(CharaEntry chara)
|
||||||
{
|
{
|
||||||
foreach (var charaentry in chara.IsMob ? instance.MobCharaData : instance.CharaData)
|
if (chara.IsMob)
|
||||||
{
|
{
|
||||||
if (Convert.ToInt32(charaentry[chara.IsMob ? "mob_id" : "id"]) == chara.Id)
|
return instance.MobCharaData.Find(e => { return Convert.ToInt32(e["mob_id"]) == chara.Id; });
|
||||||
{
|
|
||||||
return charaentry;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return null;
|
return instance.CharaData.Find(e => { return Convert.ToInt32(e["id"]) == chara.Id; });
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DataRow ReadMobDressColor(string mobid)
|
public static DataRow ReadMobDressColor(string mobid)
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public class UmaSceneController:MonoBehaviour
|
|||||||
Destroy(CavansInstance);
|
Destroy(CavansInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadingProgressChange(int curren, int target)
|
public void LoadingProgressChange(int curren, int target, string message = null)
|
||||||
{
|
{
|
||||||
if(curren == -1)
|
if(curren == -1)
|
||||||
{
|
{
|
||||||
@@ -80,8 +80,15 @@ public class UmaSceneController:MonoBehaviour
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
LoadingProgressPanel.SetActive(true);
|
LoadingProgressPanel.SetActive(true);
|
||||||
LoadingProgressText.text = $"Loading...({curren}/{target})";
|
|
||||||
LoadingProgressSlider.value = (float)curren / target;
|
LoadingProgressSlider.value = (float)curren / target;
|
||||||
|
if (string.IsNullOrEmpty(message))
|
||||||
|
{
|
||||||
|
LoadingProgressText.text = $"Loading...({curren}/{target})";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LoadingProgressText.text = $"{message}({curren}/{target})";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,8 +53,6 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
|
|
||||||
public IEnumerator LoadUma(CharaEntry chara, string costumeId, bool mini)
|
public IEnumerator LoadUma(CharaEntry chara, string costumeId, bool mini)
|
||||||
{
|
{
|
||||||
UnloadUma();
|
|
||||||
UmaAssetManager.UnloadAllBundle(true);
|
|
||||||
int id = chara.Id;
|
int id = chara.Id;
|
||||||
CurrentUMAContainer = new GameObject($"Chara_{id}_{costumeId}").AddComponent<UmaContainer>();
|
CurrentUMAContainer = new GameObject($"Chara_{id}_{costumeId}").AddComponent<UmaContainer>();
|
||||||
CurrentUMAContainer.CharaEntry = chara;
|
CurrentUMAContainer.CharaEntry = chara;
|
||||||
@@ -814,7 +812,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
|
|
||||||
//load BG
|
//load BG
|
||||||
string nameVar = $"snd_bgm_live_{songid}_oke";
|
string nameVar = $"snd_bgm_live_{songid}_oke";
|
||||||
UmaDatabaseEntry BGawb = Main.AbList.FirstOrDefault(a => a.Name.Contains(nameVar) && a.Name.EndsWith("awb"));
|
UmaDatabaseEntry BGawb = Main.AbSounds.FirstOrDefault(a => a.Name.Contains(nameVar) && a.Name.EndsWith("awb"));
|
||||||
if (BGawb != null)
|
if (BGawb != null)
|
||||||
{
|
{
|
||||||
var BGclip = LoadAudio(BGawb);
|
var BGclip = LoadAudio(BGawb);
|
||||||
@@ -907,7 +905,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
if (CurrentLyrics.Count > 0) CurrentLyrics.Clear();
|
if (CurrentLyrics.Count > 0) CurrentLyrics.Clear();
|
||||||
|
|
||||||
string lyricsVar = $"live/musicscores/m{songid}/m{songid}_lyrics";
|
string lyricsVar = $"live/musicscores/m{songid}/m{songid}_lyrics";
|
||||||
UmaDatabaseEntry lyricsAsset = Main.AbList.FirstOrDefault(a => a.Name.Contains(lyricsVar));
|
UmaDatabaseEntry lyricsAsset = Main.AbList[lyricsVar];
|
||||||
AssetBundle bundle = UmaAssetManager.LoadAssetBundle(lyricsAsset);
|
AssetBundle bundle = UmaAssetManager.LoadAssetBundle(lyricsAsset);
|
||||||
TextAsset asset = bundle.LoadAsset<TextAsset>(Path.GetFileNameWithoutExtension(lyricsVar));
|
TextAsset asset = bundle.LoadAsset<TextAsset>(Path.GetFileNameWithoutExtension(lyricsVar));
|
||||||
string[] lines = asset.text.Split("\n"[0]);
|
string[] lines = asset.text.Split("\n"[0]);
|
||||||
@@ -937,16 +935,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
{
|
{
|
||||||
foreach (string prerequisite in entry.Prerequisites.Split(';'))
|
foreach (string prerequisite in entry.Prerequisites.Split(';'))
|
||||||
{
|
{
|
||||||
if (prerequisite.StartsWith(UmaDatabaseController.CharaPath))
|
RecursiveLoadAsset(Main.AbList[prerequisite], true, SetParent);
|
||||||
{
|
|
||||||
RecursiveLoadAsset(Main.AbChara.FirstOrDefault(ab => ab.Name == prerequisite), true, SetParent);
|
|
||||||
}
|
|
||||||
else if (prerequisite.StartsWith(UmaDatabaseController.MotionPath))
|
|
||||||
{
|
|
||||||
RecursiveLoadAsset(Main.AbMotions.FirstOrDefault(ab => ab.Name == prerequisite), true, SetParent);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
RecursiveLoadAsset(Main.AbList.FirstOrDefault(ab => ab.Name == prerequisite), true, SetParent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LoadAsset(entry, IsSubAsset, SetParent);
|
LoadAsset(entry, IsSubAsset, SetParent);
|
||||||
@@ -955,7 +944,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
public void LoadAsset(UmaDatabaseEntry entry, bool IsSubAsset = false, Transform SetParent = null)
|
public void LoadAsset(UmaDatabaseEntry entry, bool IsSubAsset = false, Transform SetParent = null)
|
||||||
{
|
{
|
||||||
Debug.Log("Loading " + entry.Name);
|
Debug.Log("Loading " + entry.Name);
|
||||||
var bundle = UmaAssetManager.LoadAssetBundle(entry);
|
var bundle = UmaAssetManager.LoadAssetBundle(entry, isRecursive: false);
|
||||||
LoadBundle(bundle, IsSubAsset, SetParent);
|
LoadBundle(bundle, IsSubAsset, SetParent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1445,10 +1434,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
|
|
||||||
public void LoadAssetPath(string path, Transform SetParent)
|
public void LoadAssetPath(string path, Transform SetParent)
|
||||||
{
|
{
|
||||||
foreach (var asset in UmaViewerMain.Instance.AbList.Where(a => a.Name == path))
|
RecursiveLoadAsset(UmaViewerMain.Instance.AbList[path], false, SetParent);
|
||||||
{
|
|
||||||
RecursiveLoadAsset(asset, false, SetParent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadTear(GameObject go)
|
private void LoadTear(GameObject go)
|
||||||
@@ -1470,7 +1456,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
private void LoadFaceMorph(int id, string costumeId)
|
private void LoadFaceMorph(int id, string costumeId)
|
||||||
{
|
{
|
||||||
if (!CurrentUMAContainer.Head) return;
|
if (!CurrentUMAContainer.Head) return;
|
||||||
var locatorEntry = Main.AbList.FirstOrDefault(a => a.Name == "3d/animator/drivenkeylocator");
|
var locatorEntry = Main.AbList["3d/animator/drivenkeylocator"];
|
||||||
var bundle = UmaAssetManager.LoadAssetBundle(locatorEntry);
|
var bundle = UmaAssetManager.LoadAssetBundle(locatorEntry);
|
||||||
var locator = Instantiate(bundle.LoadAsset("DrivenKeyLocator"), CurrentUMAContainer.transform) as GameObject;
|
var locator = Instantiate(bundle.LoadAsset("DrivenKeyLocator"), CurrentUMAContainer.transform) as GameObject;
|
||||||
locator.name = "DrivenKeyLocator";
|
locator.name = "DrivenKeyLocator";
|
||||||
@@ -1670,8 +1656,17 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
string[] param = clip.name.Split('_');
|
string[] param = clip.name.Split('_');
|
||||||
if (param.Length > 4)
|
if (param.Length > 4)
|
||||||
{
|
{
|
||||||
int index = int.Parse(param[4]) + 1;
|
int index = int.Parse(param[4]);
|
||||||
var nextMotion = Main.AbMotions.FirstOrDefault(a => a.Name.EndsWith($"{param[0]}_{param[1]}_{param[2]}_{param[3]}_0{index}"));
|
if(index == 1)
|
||||||
|
{
|
||||||
|
foreach(var entry in Main.AbMotions.Where(a => a.Name.Contains($"{param[0]}_{param[1]}_{param[2]}_{param[3]}_")))
|
||||||
|
{
|
||||||
|
UmaAssetManager.LoadAssetBundle(entry, isRecursive: false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
var nextMotion = Main.AbMotions.FirstOrDefault(a => a.Name.EndsWith($"{param[0]}_{param[1]}_{param[2]}_{param[3]}_0{index}"));
|
||||||
|
|
||||||
var aevent = new AnimationEvent
|
var aevent = new AnimationEvent
|
||||||
{
|
{
|
||||||
time = clip.length * 0.99f,
|
time = clip.length * 0.99f,
|
||||||
@@ -1823,8 +1818,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
public Sprite LoadCharaIcon(string id)
|
public Sprite LoadCharaIcon(string id)
|
||||||
{
|
{
|
||||||
string value = $"chara/chr{id}/chr_icon_{id}";
|
string value = $"chara/chr{id}/chr_icon_{id}";
|
||||||
var entry = UmaViewerMain.Instance.AbList.FirstOrDefault(a => a.Name.Equals(value));
|
if (UmaViewerMain.Instance.AbList.TryGetValue(value,out UmaDatabaseEntry entry))
|
||||||
if (entry != null)
|
|
||||||
{
|
{
|
||||||
AssetBundle assetBundle = UmaAssetManager.LoadAssetBundle(entry, true);
|
AssetBundle assetBundle = UmaAssetManager.LoadAssetBundle(entry, true);
|
||||||
if (assetBundle.Contains($"chr_icon_{id}"))
|
if (assetBundle.Contains($"chr_icon_{id}"))
|
||||||
@@ -1841,16 +1835,16 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
public Sprite LoadMobCharaIcon(string id)
|
public Sprite LoadMobCharaIcon(string id)
|
||||||
{
|
{
|
||||||
string value = $"mob/mob_chr_icon_{id}_000001_01";
|
string value = $"mob/mob_chr_icon_{id}_000001_01";
|
||||||
var entry = UmaViewerMain.Instance.AbList.FirstOrDefault(a => a.Name.Equals(value));
|
if (UmaViewerMain.Instance.AbList.TryGetValue(value,out UmaDatabaseEntry entry)) {
|
||||||
if (entry == null) { return null; }
|
string path = entry.FilePath;
|
||||||
string path = entry.FilePath;
|
AssetBundle assetBundle = UmaAssetManager.LoadAssetBundle(entry, true);
|
||||||
AssetBundle assetBundle = UmaAssetManager.LoadAssetBundle(entry, true);
|
if (assetBundle.Contains($"mob_chr_icon_{id}_000001_01"))
|
||||||
if (assetBundle.Contains($"mob_chr_icon_{id}_000001_01"))
|
{
|
||||||
{
|
Texture2D texture = (Texture2D)assetBundle.LoadAsset($"mob_chr_icon_{id}_000001_01");
|
||||||
Texture2D texture = (Texture2D)assetBundle.LoadAsset($"mob_chr_icon_{id}_000001_01");
|
Sprite sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.zero);
|
||||||
Sprite sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.zero);
|
assetBundle.Unload(false);
|
||||||
assetBundle.Unload(false);
|
return sprite;
|
||||||
return sprite;
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -1867,15 +1861,17 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
public Sprite LoadLiveIcon(int musicid)
|
public Sprite LoadLiveIcon(int musicid)
|
||||||
{
|
{
|
||||||
string value = $"live/jacket/jacket_icon_l_{musicid}";
|
string value = $"live/jacket/jacket_icon_l_{musicid}";
|
||||||
var entry = UmaViewerMain.Instance.AbList.FirstOrDefault(a => a.Name.Equals(value));
|
|
||||||
if (entry == null) return null;
|
if (UmaViewerMain.Instance.AbList.TryGetValue(value, out UmaDatabaseEntry entry))
|
||||||
AssetBundle assetBundle = UmaAssetManager.LoadAssetBundle(entry, true);
|
|
||||||
if (assetBundle.Contains($"jacket_icon_l_{musicid}"))
|
|
||||||
{
|
{
|
||||||
Texture2D texture = (Texture2D)assetBundle.LoadAsset($"jacket_icon_l_{musicid}");
|
AssetBundle assetBundle = UmaAssetManager.LoadAssetBundle(entry, true);
|
||||||
Sprite sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.zero);
|
if (assetBundle.Contains($"jacket_icon_l_{musicid}"))
|
||||||
assetBundle.Unload(false);
|
{
|
||||||
return sprite;
|
Texture2D texture = (Texture2D)assetBundle.LoadAsset($"jacket_icon_l_{musicid}");
|
||||||
|
Sprite sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.zero);
|
||||||
|
assetBundle.Unload(false);
|
||||||
|
return sprite;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public class UmaViewerMain : MonoBehaviour
|
|||||||
public List<CharaEntry> MobCharacters = new List<CharaEntry>();
|
public List<CharaEntry> MobCharacters = new List<CharaEntry>();
|
||||||
public List<LiveEntry> Lives = new List<LiveEntry>();
|
public List<LiveEntry> Lives = new List<LiveEntry>();
|
||||||
public List<CostumeEntry> Costumes = new List<CostumeEntry>();
|
public List<CostumeEntry> Costumes = new List<CostumeEntry>();
|
||||||
public List<UmaDatabaseEntry> AbList = new List<UmaDatabaseEntry>();
|
public Dictionary<string,UmaDatabaseEntry> AbList = new Dictionary<string, UmaDatabaseEntry>();
|
||||||
public List<UmaDatabaseEntry> AbMotions = new List<UmaDatabaseEntry>();
|
public List<UmaDatabaseEntry> AbMotions = new List<UmaDatabaseEntry>();
|
||||||
public List<UmaDatabaseEntry> AbSounds = new List<UmaDatabaseEntry>();
|
public List<UmaDatabaseEntry> AbSounds = new List<UmaDatabaseEntry>();
|
||||||
public List<UmaDatabaseEntry> AbChara = new List<UmaDatabaseEntry>();
|
public List<UmaDatabaseEntry> AbChara = new List<UmaDatabaseEntry>();
|
||||||
@@ -28,27 +28,25 @@ public class UmaViewerMain : MonoBehaviour
|
|||||||
Instance = this;
|
Instance = this;
|
||||||
new Config();
|
new Config();
|
||||||
Application.targetFrameRate = 120;
|
Application.targetFrameRate = 120;
|
||||||
AbList = UmaDatabaseController.Instance.MetaEntries.ToList();
|
AbList = UmaDatabaseController.Instance.MetaEntries;
|
||||||
AbChara = AbList.Where(ab => ab.Name.StartsWith(UmaDatabaseController.CharaPath)).ToList();
|
AbChara = AbList.Where(ab => ab.Key.StartsWith(UmaDatabaseController.CharaPath)).Select(ab=>ab.Value).ToList();
|
||||||
AbMotions = AbList.Where(ab => ab.Name.StartsWith(UmaDatabaseController.MotionPath)).ToList();
|
AbMotions = AbList.Where(ab => ab.Key.StartsWith(UmaDatabaseController.MotionPath)).Select(ab => ab.Value).ToList();
|
||||||
AbEffect = AbList.Where(ab => ab.Name.StartsWith(UmaDatabaseController.EffectPath)).ToList();
|
AbEffect = AbList.Where(ab => ab.Key.StartsWith(UmaDatabaseController.EffectPath)).Select(ab => ab.Value).ToList();
|
||||||
AbSounds = AbList.Where(ab => ab.Name.EndsWith(".awb") || ab.Name.EndsWith(".acb")).ToList();
|
AbSounds = AbList.Where(ab => ab.Key.EndsWith(".awb") || ab.Key.EndsWith(".acb")).Select(ab => ab.Value).ToList();
|
||||||
CostumeList = AbList.Where(ab => ab.Name.StartsWith(UmaDatabaseController.CostumePath)).ToList();
|
CostumeList = AbList.Where(ab => ab.Key.StartsWith(UmaDatabaseController.CostumePath)).Select(ab => ab.Value).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerator Start()
|
private IEnumerator Start()
|
||||||
{
|
{
|
||||||
Dictionary<int, string> enNames = new Dictionary<int, string>();
|
Dictionary<int, string> enNames = new Dictionary<int, string>();
|
||||||
Dictionary<int, string> mobNames = new Dictionary<int, string>();
|
Dictionary<int, string> mobNames = new Dictionary<int, string>();
|
||||||
|
var loadingUI = UmaSceneController.instance;
|
||||||
if(Config.Instance.WorkMode == WorkMode.Standalone)
|
|
||||||
{
|
|
||||||
UI.ShowMessage("Initializing...",UIMessageType.Default);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Main chara names (En only)
|
//Main chara names (En only)
|
||||||
if (Config.Instance.Language == Language.En)
|
if (Config.Instance.Language == Language.En)
|
||||||
{
|
{
|
||||||
|
loadingUI.LoadingProgressChange(0, 11, "Downloading Character Data");
|
||||||
|
yield return null;
|
||||||
yield return UmaViewerDownload.DownloadText("https://www.tracenacademy.com/api/BasicCharaDataInfo", txt =>
|
yield return UmaViewerDownload.DownloadText("https://www.tracenacademy.com/api/BasicCharaDataInfo", txt =>
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(txt)) return;
|
if (string.IsNullOrEmpty(txt)) return;
|
||||||
@@ -61,8 +59,10 @@ public class UmaViewerMain : MonoBehaviour
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//Mob names (EN & JP)
|
//Mob names (EN & JP)
|
||||||
|
loadingUI.LoadingProgressChange(1, 11, "Downloading Mob Data");
|
||||||
|
yield return null;
|
||||||
yield return UmaViewerDownload.DownloadText("https://www.tracenacademy.com/api/BasicMobDataInfo", txt =>
|
yield return UmaViewerDownload.DownloadText("https://www.tracenacademy.com/api/BasicMobDataInfo", txt =>
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(txt)) return;
|
if (string.IsNullOrEmpty(txt)) return;
|
||||||
@@ -77,6 +77,8 @@ public class UmaViewerMain : MonoBehaviour
|
|||||||
|
|
||||||
|
|
||||||
var UmaCharaData = UmaDatabaseController.Instance.CharaData;
|
var UmaCharaData = UmaDatabaseController.Instance.CharaData;
|
||||||
|
loadingUI.LoadingProgressChange(2, 11, "Loading Character Data");
|
||||||
|
yield return null;
|
||||||
foreach (var item in UmaCharaData)
|
foreach (var item in UmaCharaData)
|
||||||
{
|
{
|
||||||
var id = Convert.ToInt32(item["id"]);
|
var id = Convert.ToInt32(item["id"]);
|
||||||
@@ -94,6 +96,8 @@ public class UmaViewerMain : MonoBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
var MobCharaData = UmaDatabaseController.Instance.MobCharaData;
|
var MobCharaData = UmaDatabaseController.Instance.MobCharaData;
|
||||||
|
loadingUI.LoadingProgressChange(3, 11, "Loading Mob Data");
|
||||||
|
yield return null;
|
||||||
foreach (var item in MobCharaData)
|
foreach (var item in MobCharaData)
|
||||||
{
|
{
|
||||||
if (Convert.ToInt32(item["use_live"]) == 0)
|
if (Convert.ToInt32(item["use_live"]) == 0)
|
||||||
@@ -112,6 +116,8 @@ public class UmaViewerMain : MonoBehaviour
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loadingUI.LoadingProgressChange(4, 11, "Loading Costumes Data");
|
||||||
|
yield return null;
|
||||||
foreach (var item in CostumeList)
|
foreach (var item in CostumeList)
|
||||||
{
|
{
|
||||||
var costume = new CostumeEntry();
|
var costume = new CostumeEntry();
|
||||||
@@ -134,12 +140,9 @@ public class UmaViewerMain : MonoBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UI.LoadModelPanels();
|
loadingUI.LoadingProgressChange(5, 11, "Loading Live Data");
|
||||||
UI.LoadMiniModelPanels();
|
yield return null;
|
||||||
UI.LoadPropPanel();
|
var asset = AbList["livesettings"];
|
||||||
UI.LoadMapPanel();
|
|
||||||
|
|
||||||
var asset = AbList.FirstOrDefault(a => a.Name.Equals("livesettings"));
|
|
||||||
if (asset != null)
|
if (asset != null)
|
||||||
{
|
{
|
||||||
string filePath = asset.FilePath;
|
string filePath = asset.FilePath;
|
||||||
@@ -170,14 +173,27 @@ public class UmaViewerMain : MonoBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UI.LoadLivePanels();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.Instance.WorkMode == WorkMode.Standalone)
|
loadingUI.LoadingProgressChange(6, 11, "Loading UI");
|
||||||
{
|
yield return null;
|
||||||
UI.ShowMessage("Done.", UIMessageType.Close);
|
UI.LoadModelPanels();
|
||||||
}
|
loadingUI.LoadingProgressChange(7, 11, "Loading UI");
|
||||||
|
yield return null;
|
||||||
|
UI.LoadMiniModelPanels();
|
||||||
|
loadingUI.LoadingProgressChange(8, 11, "Loading UI");
|
||||||
|
yield return null;
|
||||||
|
UI.LoadPropPanel();
|
||||||
|
loadingUI.LoadingProgressChange(9, 11, "Loading UI");
|
||||||
|
yield return null;
|
||||||
|
UI.LoadMapPanel();
|
||||||
|
loadingUI.LoadingProgressChange(10, 11, "Loading UI");
|
||||||
|
yield return null;
|
||||||
|
UI.LoadLivePanels();
|
||||||
|
loadingUI.LoadingProgressChange(-1, -1);
|
||||||
|
|
||||||
|
UmaAssetManager.LoadAssetBundle(AbList["shader"], true); //Load Shader First
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OpenUrl(string url)
|
public void OpenUrl(string url)
|
||||||
|
|||||||
@@ -614,14 +614,14 @@ public class UmaViewerUI : MonoBehaviour
|
|||||||
public void LoadPropPanel()
|
public void LoadPropPanel()
|
||||||
{
|
{
|
||||||
var pageentrys = new List<PageManager.Entry>();
|
var pageentrys = new List<PageManager.Entry>();
|
||||||
foreach (var prop in Main.AbList.Where(a => a.Name.Contains("pfb_chr_prop") && !a.Name.Contains("clothes")))
|
foreach (var prop in Main.AbList.Where(a => a.Key.Contains("pfb_chr_prop") && !a.Key.Contains("clothes")))
|
||||||
{
|
{
|
||||||
var pageentry = new PageManager.Entry();
|
var pageentry = new PageManager.Entry();
|
||||||
pageentry.Name = Path.GetFileName(prop.Name);
|
pageentry.Name = Path.GetFileName(prop.Key);
|
||||||
pageentry.OnClick = (container) =>
|
pageentry.OnClick = (container) =>
|
||||||
{
|
{
|
||||||
HighlightChildImage(PropList.content, container);
|
HighlightChildImage(PropList.content, container);
|
||||||
Builder.LoadProp(prop);
|
Builder.LoadProp(prop.Value);
|
||||||
};
|
};
|
||||||
pageentrys.Add(pageentry);
|
pageentrys.Add(pageentry);
|
||||||
}
|
}
|
||||||
@@ -631,15 +631,15 @@ public class UmaViewerUI : MonoBehaviour
|
|||||||
public void LoadMapPanel()
|
public void LoadMapPanel()
|
||||||
{
|
{
|
||||||
var pageentrys = new List<PageManager.Entry>();
|
var pageentrys = new List<PageManager.Entry>();
|
||||||
foreach (var scene in Main.AbList.Where(a => ((a.Name.StartsWith("3d/env") && Path.GetFileName(a.Name).StartsWith("pfb_")) || a.Name.StartsWith("cutt/cutt_son") && Path.GetFileName(a.Name).StartsWith("cutt_son"))))
|
foreach (var scene in Main.AbList.Where(a => ((a.Key.StartsWith("3d/env") && Path.GetFileName(a.Key).StartsWith("pfb_")) || a.Key.StartsWith("cutt/cutt_son") && Path.GetFileName(a.Key).StartsWith("cutt_son"))))
|
||||||
{
|
{
|
||||||
var pageentry = new PageManager.Entry();
|
var pageentry = new PageManager.Entry();
|
||||||
pageentry.Name = Path.GetFileName(scene.Name);
|
pageentry.Name = Path.GetFileName(scene.Key);
|
||||||
pageentry.FontSize = 19;
|
pageentry.FontSize = 19;
|
||||||
pageentry.OnClick = (container) =>
|
pageentry.OnClick = (container) =>
|
||||||
{
|
{
|
||||||
HighlightChildImage(SceneList.content, container);
|
HighlightChildImage(SceneList.content, container);
|
||||||
Builder.LoadProp(scene);
|
Builder.LoadProp(scene.Value);
|
||||||
};
|
};
|
||||||
pageentrys.Add(pageentry);
|
pageentrys.Add(pageentry);
|
||||||
}
|
}
|
||||||
@@ -726,10 +726,10 @@ public class UmaViewerUI : MonoBehaviour
|
|||||||
Action<CharaEntry> action = delegate (CharaEntry achara)
|
Action<CharaEntry> action = delegate (CharaEntry achara)
|
||||||
{
|
{
|
||||||
string nameVar = mini ? $"pfb_mbdy{achara.Id}" : $"pfb_bdy{achara.Id}";
|
string nameVar = mini ? $"pfb_mbdy{achara.Id}" : $"pfb_bdy{achara.Id}";
|
||||||
foreach (var entry in Main.AbList.Where(a => !a.Name.Contains("clothes") && a.Name.Contains(nameVar)))
|
foreach (var entry in Main.AbList.Where(a => !a.Key.Contains("clothes") && a.Key.Contains(nameVar)))
|
||||||
{
|
{
|
||||||
var container = Instantiate(UmaContainerCostumePrefab, costumeList.content).GetComponent<UmaUIContainer>();
|
var container = Instantiate(UmaContainerCostumePrefab, costumeList.content).GetComponent<UmaUIContainer>();
|
||||||
string[] split = entry.Name.Split('_');
|
string[] split = entry.Key.Split('_');
|
||||||
string costumeId = split[split.Length - 1];
|
string costumeId = split[split.Length - 1];
|
||||||
var dressdata = Main.Costumes.FirstOrDefault(a => (a.CharaId == achara.Id && a.BodyTypeSub == int.Parse(costumeId)));
|
var dressdata = Main.Costumes.FirstOrDefault(a => (a.CharaId == achara.Id && a.BodyTypeSub == int.Parse(costumeId)));
|
||||||
container.Name = container.name = GetCostumeName(costumeId, (dressdata == null ? costumeId : dressdata.DressName));
|
container.Name = container.name = GetCostumeName(costumeId, (dressdata == null ? costumeId : dressdata.DressName));
|
||||||
@@ -745,8 +745,18 @@ public class UmaViewerUI : MonoBehaviour
|
|||||||
{
|
{
|
||||||
HighlightChildImage(costumeList.content, container);
|
HighlightChildImage(costumeList.content, container);
|
||||||
var list = new List<UmaDatabaseEntry>();
|
var list = new List<UmaDatabaseEntry>();
|
||||||
list.AddRange(Main.AbChara.FindAll(a => a.Name.Contains($"{achara.Id}")));
|
list.AddRange(Main.AbChara.Where(a => a.Name.StartsWith(UmaDatabaseController.BodyPath) && a.Name.Contains(chara.Id.ToString())));
|
||||||
UmaAssetManager.PreLoadAndRun(list , delegate { StartCoroutine(Builder.LoadUma(achara, costumeId, mini)); });
|
list.AddRange(Main.AbChara.Where(a => a.Name.StartsWith(UmaDatabaseController.HeadPath) && a.Name.Contains(chara.Id.ToString())));
|
||||||
|
list.AddRange(Main.AbChara.Where(a => a.Name.StartsWith("3d/chara/tail")));
|
||||||
|
list.Add(Main.AbList["3d/animator/drivenkeylocator"]);
|
||||||
|
list.Add(Main.AbMotions.FirstOrDefault(a => a.Name.EndsWith($"anm_eve_chr{chara.Id}_00_idle01_loop")));
|
||||||
|
|
||||||
|
|
||||||
|
Builder.UnloadUma();
|
||||||
|
//UmaAssetManager.UnloadAllBundle(true);
|
||||||
|
UmaAssetManager.PreLoadAndRun(list , delegate {
|
||||||
|
StartCoroutine(Builder.LoadUma(achara, costumeId, mini));
|
||||||
|
});
|
||||||
//StartCoroutine(Builder.LoadUma(achara, costumeId, mini));
|
//StartCoroutine(Builder.LoadUma(achara, costumeId, mini));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -787,7 +797,20 @@ public class UmaViewerUI : MonoBehaviour
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
HighlightChildImage(costumeList.content, container);
|
HighlightChildImage(costumeList.content, container);
|
||||||
StartCoroutine(Builder.LoadUma(chara, costumeId, mini));
|
var list = new List<UmaDatabaseEntry>();
|
||||||
|
list.AddRange(Main.AbChara.Where(a => a.Name.StartsWith(UmaDatabaseController.BodyPath) && a.Name.Contains(chara.Id.ToString())));
|
||||||
|
list.AddRange(Main.AbChara.Where(a => a.Name.StartsWith(UmaDatabaseController.HeadPath) && a.Name.Contains(chara.Id.ToString())));
|
||||||
|
list.AddRange(Main.AbChara.Where(a => a.Name.StartsWith("3d/chara/tail")));
|
||||||
|
list.Add(Main.AbList["3d/animator/drivenkeylocator"]);
|
||||||
|
list.Add(Main.AbMotions.FirstOrDefault(a => a.Name.EndsWith($"anm_eve_chr{chara.Id}_00_idle01_loop")));
|
||||||
|
|
||||||
|
|
||||||
|
Builder.UnloadUma();
|
||||||
|
//UmaAssetManager.UnloadAllBundle(true);
|
||||||
|
UmaAssetManager.PreLoadAndRun(list, delegate {
|
||||||
|
StartCoroutine(Builder.LoadUma(chara, costumeId, mini));
|
||||||
|
});
|
||||||
|
//StartCoroutine(Builder.LoadUma(achara, costumeId, mini));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -958,13 +981,12 @@ public class UmaViewerUI : MonoBehaviour
|
|||||||
|
|
||||||
void ListBackgrounds()
|
void ListBackgrounds()
|
||||||
{
|
{
|
||||||
var bglist = Main.AbList.Where(a => a.Name.StartsWith("bg/bg"));
|
|
||||||
var pageentrys = new List<PageManager.Entry>();
|
var pageentrys = new List<PageManager.Entry>();
|
||||||
foreach (var entry in bglist)
|
foreach (var entry in Main.AbList.Where(a => a.Key.StartsWith("bg/bg")))
|
||||||
{
|
{
|
||||||
var pageentry = new PageManager.Entry();
|
var pageentry = new PageManager.Entry();
|
||||||
pageentry.Name = Path.GetFileName(entry.Name);
|
pageentry.Name = Path.GetFileName(entry.Key);
|
||||||
pageentry.Sprite = Builder.LoadSprite(entry);
|
pageentry.Sprite = Builder.LoadSprite(entry.Value);
|
||||||
if (pageentry.Sprite == null) continue;
|
if (pageentry.Sprite == null) continue;
|
||||||
pageentry.OnClick = (container) =>
|
pageentry.OnClick = (container) =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -371,7 +371,7 @@ namespace Gallop.Live
|
|||||||
};
|
};
|
||||||
|
|
||||||
//Get live parts info
|
//Get live parts info
|
||||||
UmaDatabaseEntry partAsset = UmaViewerMain.Instance.AbList.FirstOrDefault(a => a.Name.Contains(string.Format(LIVE_PART_PATH, live.MusicId)));
|
UmaDatabaseEntry partAsset = UmaViewerMain.Instance.AbList[string.Format(LIVE_PART_PATH, live.MusicId)];
|
||||||
|
|
||||||
Debug.Log(partAsset.Name);
|
Debug.Log(partAsset.Name);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user