Support model combination.
This commit is contained in:
@@ -17,6 +17,12 @@ public class UmaCharaData
|
|||||||
public string tail_model_id;
|
public string tail_model_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class UmaHeadData
|
||||||
|
{
|
||||||
|
public int id;
|
||||||
|
public string costumeId;
|
||||||
|
}
|
||||||
|
|
||||||
public class UmaLyricsData
|
public class UmaLyricsData
|
||||||
{
|
{
|
||||||
public float time;
|
public float time;
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
public UmaContainer CurrentLiveContainer;
|
public UmaContainer CurrentLiveContainer;
|
||||||
public UmaContainer CurrentOtherContainer;
|
public UmaContainer CurrentOtherContainer;
|
||||||
|
|
||||||
|
public UmaHeadData CurrentHead;
|
||||||
|
|
||||||
public List<AudioSource> CurrentAudioSources = new List<AudioSource>();
|
public List<AudioSource> CurrentAudioSources = new List<AudioSource>();
|
||||||
public List<UmaLyricsData> CurrentLyrics = new List<UmaLyricsData>();
|
public List<UmaLyricsData> CurrentLyrics = new List<UmaLyricsData>();
|
||||||
|
|
||||||
@@ -167,20 +169,38 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string head = UmaDatabaseController.HeadPath + $"chr{id}_{costumeId}/pfb_chr{id}_{costumeId}";
|
// Record Head Data
|
||||||
|
int head_id;
|
||||||
|
string head_costumeId;
|
||||||
|
if (UI.isHeadFix && CurrentHead != null)
|
||||||
|
{
|
||||||
|
head_id = CurrentHead.id;
|
||||||
|
head_costumeId = CurrentHead.costumeId;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
head_id = id;
|
||||||
|
head_costumeId = costumeId;
|
||||||
|
|
||||||
|
CurrentHead = new UmaHeadData();
|
||||||
|
CurrentHead.id = id;
|
||||||
|
CurrentHead.costumeId = costumeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
string head = UmaDatabaseController.HeadPath + $"chr{head_id}_{head_costumeId}/pfb_chr{head_id}_{head_costumeId}";
|
||||||
asset = UmaViewerMain.Instance.AbList.FirstOrDefault(a => a.Name == head);
|
asset = UmaViewerMain.Instance.AbList.FirstOrDefault(a => a.Name == head);
|
||||||
bool isDefaultHead = false;
|
bool isDefaultHead = false;
|
||||||
//Some costumes don't have custom heads
|
//Some costumes don't have custom heads
|
||||||
if (costumeId != "00" && asset == null)
|
if (costumeId != "00" && asset == null)
|
||||||
{
|
{
|
||||||
asset = UmaViewerMain.Instance.AbList.FirstOrDefault(a => a.Name == UmaDatabaseController.HeadPath + $"chr{id}_00/pfb_chr{id}_00");
|
asset = UmaViewerMain.Instance.AbList.FirstOrDefault(a => a.Name == UmaDatabaseController.HeadPath + $"chr{head_id}_00/pfb_chr{head_id}_00");
|
||||||
isDefaultHead = true;
|
isDefaultHead = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (asset != null)
|
if (asset != null)
|
||||||
{
|
{
|
||||||
//Load Hair Textures
|
//Load Hair Textures
|
||||||
foreach (var asset1 in UmaViewerMain.Instance.AbList.Where(a => a.Name.StartsWith($"{UmaDatabaseController.HeadPath}chr{id}_{costumeId}/textures")))
|
foreach (var asset1 in UmaViewerMain.Instance.AbList.Where(a => a.Name.StartsWith($"{UmaDatabaseController.HeadPath}chr{head_id}_{head_costumeId}/textures")))
|
||||||
{
|
{
|
||||||
RecursiveLoadAsset(asset1);
|
RecursiveLoadAsset(asset1);
|
||||||
}
|
}
|
||||||
@@ -190,7 +210,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
//Load Physics
|
//Load Physics
|
||||||
if (isDefaultHead)
|
if (isDefaultHead)
|
||||||
{
|
{
|
||||||
foreach (var asset1 in UmaViewerMain.Instance.AbList.Where(a => a.Name.StartsWith($"{UmaDatabaseController.HeadPath}chr{id}_00/clothes")))
|
foreach (var asset1 in UmaViewerMain.Instance.AbList.Where(a => a.Name.StartsWith($"{UmaDatabaseController.HeadPath}chr{head_id}_00/clothes")))
|
||||||
{
|
{
|
||||||
if (asset1.Name.Contains("cloth00"))
|
if (asset1.Name.Contains("cloth00"))
|
||||||
RecursiveLoadAsset(asset1);
|
RecursiveLoadAsset(asset1);
|
||||||
@@ -198,7 +218,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach (var asset1 in UmaViewerMain.Instance.AbList.Where(a => a.Name.StartsWith($"{UmaDatabaseController.HeadPath}chr{id}_{costumeId}/clothes")))
|
foreach (var asset1 in UmaViewerMain.Instance.AbList.Where(a => a.Name.StartsWith($"{UmaDatabaseController.HeadPath}chr{head_id}_{head_costumeId}/clothes")))
|
||||||
{
|
{
|
||||||
if (asset1.Name.Contains("cloth00"))
|
if (asset1.Name.Contains("cloth00"))
|
||||||
RecursiveLoadAsset(asset1);
|
RecursiveLoadAsset(asset1);
|
||||||
@@ -206,6 +226,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int tailId = (int)charaData["tailModelId"];
|
int tailId = (int)charaData["tailModelId"];
|
||||||
if (tailId != 0)
|
if (tailId != 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -57,7 +57,8 @@ public class UmaViewerUI : MonoBehaviour
|
|||||||
|
|
||||||
public Color UIColor1, UIColor2;
|
public Color UIColor1, UIColor2;
|
||||||
|
|
||||||
public bool isCirware = false;
|
public bool isCriware = false;
|
||||||
|
public bool isHeadFix = false;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
@@ -276,7 +277,13 @@ public class UmaViewerUI : MonoBehaviour
|
|||||||
|
|
||||||
public void SetCriWare(bool value)
|
public void SetCriWare(bool value)
|
||||||
{
|
{
|
||||||
isCirware = value;
|
isCriware = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetHeadFix(bool value)
|
||||||
|
{
|
||||||
|
isHeadFix = value;
|
||||||
|
UnityEngine.Debug.Log(isHeadFix);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ListLiveSounds(int songid)
|
void ListLiveSounds(int songid)
|
||||||
@@ -294,7 +301,7 @@ public class UmaViewerUI : MonoBehaviour
|
|||||||
container.Name.text = name;
|
container.Name.text = name;
|
||||||
container.Button.onClick.AddListener(() => {
|
container.Button.onClick.AddListener(() => {
|
||||||
HighlightChildImage(LiveCharaSoundList.content, container.GetComponent<Image>());
|
HighlightChildImage(LiveCharaSoundList.content, container.GetComponent<Image>());
|
||||||
if (isCirware)
|
if (isCriware)
|
||||||
{
|
{
|
||||||
Builder.LoadLiveSoundCri(songid, entry);
|
Builder.LoadLiveSoundCri(songid, entry);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user