Sync fork (#73)

* Improved UI layout and live vocals

* New Live Compatibility

* Android build support

* Update build.yml

* Fix issues with the new version of the game

* add config button

* Improve performance

* bug fix, new uma compatibility

---------

Co-authored-by: CroakFang <1605296300@qq.com>
This commit is contained in:
katboi01
2024-11-06 23:58:45 +01:00
committed by GitHub
parent 817b8a3954
commit d97cb906de
23 changed files with 919 additions and 269 deletions
@@ -954,37 +954,49 @@ namespace Gallop
if (updateInfo_.effect != null)
{
var info = updateInfo_.effect;
var cheektype = info.cheekType;
for (int i = 0; i < CheekMorph.BindProperties.Count; i++)
if (CheekMorph != null)
{
CheekMorph.BindProperties[i].Value = (cheektype - 1 == i ? 1 : 0);
var cheektype = info.cheekType;
for (int i = 0; i < CheekMorph.BindProperties.Count; i++)
{
CheekMorph.BindProperties[i].Value = (cheektype - 1 == i ? 1 : 0);
}
}
var mangatype = info.mangameIndex;
if (mangatype == 0)
if (MangaMorph != null)
{
HasManga = false;
MangaMorph.BindProperties[1].Value = mangatype;
}
else
{
HasManga = true;
MangaMorph.BindProperties[0].Value = mangatype - 1;
MangaMorph.BindProperties[1].Value = 1;
var mangatype = info.mangameIndex;
if (mangatype == 0)
{
HasManga = false;
MangaMorph.BindProperties[1].Value = mangatype;
}
else
{
HasManga = true;
MangaMorph.BindProperties[0].Value = mangatype - 1;
MangaMorph.BindProperties[1].Value = 1;
}
}
var tearfulEnable = ((int)info.attribute & LiveTimelineKeyFacialEffectData.kAttrTearful) > 0;
var tearfultype = tearfulEnable ? info.tearyType : 0;
StaticTearMorph.BindProperties.ForEach(p => p.Value = tearfultype);
var shaderEnable = ((int)info.attribute & LiveTimelineKeyFacialEffectData.kAttrFaceShadowVisible) > 0;
if (shaderEnable)
if (StaticTearMorph != null)
{
ShadeMorph.BindProperties[0].Value = Mathf.MoveTowards(ShadeMorph.BindProperties[0].Value, 1, Time.deltaTime * 2);
var tearfulEnable = ((int)info.attribute & LiveTimelineKeyFacialEffectData.kAttrTearful) > 0;
var tearfultype = tearfulEnable ? info.tearyType : 0;
StaticTearMorph.BindProperties.ForEach(p => p.Value = tearfultype);
}
else
if (ShadeMorph != null)
{
ShadeMorph.BindProperties[0].Value = 0;
var shaderEnable = ((int)info.attribute & LiveTimelineKeyFacialEffectData.kAttrFaceShadowVisible) > 0;
if (shaderEnable)
{
ShadeMorph.BindProperties[0].Value = Mathf.MoveTowards(ShadeMorph.BindProperties[0].Value, 1, Time.deltaTime * 2);
}
else
{
ShadeMorph.BindProperties[0].Value = 0;
}
}
ChangeMorphEffect();
}
@@ -5,7 +5,6 @@ using UnityEngine;
using static RootMotion.FinalIK.IKSolverVR;
using System.Linq;
using System.IO;
using static UnityEngine.Rendering.VirtualTexturing.Debugging;
using static Gallop.Live.Cutt.LiveTimelineDefine;
namespace Gallop.Live.Cutt
@@ -355,7 +354,7 @@ namespace Gallop.Live.Cutt
MulFrame.Add(mulframe);
}
if (currentFrame % 2 == 0) RecordUma?.Invoke();
if (currentFrame % 2 == 0) RecordUma?.Invoke(); //Set 30 FPS
}
}
@@ -72,7 +72,10 @@ namespace Gallop.Live.Cutt
{
foreach (var key in _currentKey.thisList)
{
_tempAnim.AddClip(key.clip, key.clip.name);
if(key.clip != null)
{
_tempAnim.AddClip(key.clip, key.clip.name);
}
}
}
_tempAnim.wrapMode = WrapMode.Clamp;
@@ -122,13 +125,15 @@ namespace Gallop.Live.Cutt
double interval = (currentTime - arg.FrameSecond) * arg.playSpeed;
float currentAnimationTime = (float)(start + interval);
var state = _tempAnim[anim.name];
state.enabled = true;
state.weight = 1;
state.time = arg.loop ? Mathf.Repeat(currentAnimationTime, state.length) : currentAnimationTime;
_tempAnim.Sample();
state.enabled = false;
if (anim)
{
var state = _tempAnim[anim.name];
state.enabled = true;
state.weight = 1;
state.time = arg.loop ? Mathf.Repeat(currentAnimationTime, state.length) : currentAnimationTime;
_tempAnim.Sample();
state.enabled = false;
}
_prevIndex = _curIndex;
}
_prevFrameAnimationTime = currentTime;
@@ -376,7 +376,11 @@ namespace Gallop.Live
if (_syncTime == false)
{
if (liveMusic.sourceList[0].time > 0.01)
if(liveMusic.sourceList.Count == 0)
{
_syncTime = true;
}
else if (liveMusic.sourceList[0].time > 0.01)
{
_liveCurrentTime = liveMusic.sourceList[0].time;
_syncTime = true;
@@ -545,6 +549,44 @@ namespace Gallop.Live
UnityCameraVMDRecorder.SaveLiveCameraVMD(live, ExitTime, frames);
}
public static List<UmaDatabaseEntry> GetLiveAllVoiceEntry(int songid, List<LiveCharacterSelect> characters)
{
List<UmaDatabaseEntry> entryList = new List <UmaDatabaseEntry>();
for (int i = 0; i < characters.Count; i++)
{
if (characters[i].CharaEntry.Name != "")
{
var charaid = characters[i].CharaEntry.Id;
var entry = UmaViewerMain.Instance.AbSounds.FirstOrDefault(a => a.Name.Contains(string.Format(VOCAL_PATH, songid, charaid)) && a.Name.EndsWith("awb"));
if (entry == null)
{
List<UmaDatabaseEntry> entries = new List<UmaDatabaseEntry>();
foreach (var random in UmaViewerMain.Instance.AbSounds.Where(a => (a.Name.Contains(string.Format(RANDOM_VOCAL_PATH, songid)) && a.Name.EndsWith("awb"))))
{
entries.Add(random);
}
if (entries.Count > 0)
{
entry = entries[UnityEngine.Random.Range(0, entries.Count - 1)];
}
}
if (entry != null)
{
entryList.Add(entry);
}
}
}
var bgEntry = UmaViewerMain.Instance.AbSounds.FirstOrDefault(a => a.Name.Contains(string.Format(SONG_PATH, songid)) && a.Name.EndsWith("awb"));
if (bgEntry != null)
{
entryList.Add(bgEntry);
}
return entryList;
}
}
}