Add custom head, live character shader control, and live stage control. (#88)

* Bug fix, improved UI layout and live vocals

* Bug Fixes, New Live Compatibility

* Android build support

* Update build.yml

* Update build.yml

* Update build.yml

* Update build.yml

* Update build.yml

* Update build.yml

* Fix issues with the new version of the game

* bug fix

* add config button

* Improve performance

* Sync fork

* bug fix, new uma compatibility

* Add /UserSettings to gitignore

* bug fix, add live characher shader control

* fix compilation errors

* fix compilation errors 2

* fix the live lighting calculation logic

* bug fix, add editor layout settings to gitignore

* bug fix, add editor layout settings to gitignore

* Add time scale keys for live

* live camera bug fix

* add live stage control, optimize live performance

* fix build error

* add uma head custom
This commit is contained in:
CroakFang
2025-07-11 23:23:57 +08:00
committed by GitHub
parent a42ea93ffd
commit 204752d7d6
45 changed files with 2140 additions and 1339 deletions
@@ -104,6 +104,7 @@ namespace Gallop.Live
{
Debug.Log(live.BackGroundId);
Builder.LoadAssetPath(string.Format(STAGE_PATH, live.BackGroundId), transform);
_liveTimelineControl.StageObjectMap = _stageController.StageObjectMap;
}
//Make CharacterObject
@@ -187,6 +188,7 @@ namespace Gallop.Live
}
}
};
_liveTimelineControl.OnUpdateFacial += delegate (FacialDataUpdateInfo updateInfo_, float liveTime_, int position)
{
if (position < charaObjs.Count)
@@ -195,6 +197,71 @@ namespace Gallop.Live
container.FaceDrivenKeyTarget.AlterUpdateFacialNew(ref updateInfo_, liveTime_);
}
};
_liveTimelineControl.OnUpdateGlobalLight += delegate (ref GlobalLightUpdateInfo updateInfo)
{
var tmpPos = -(updateInfo.lightRotation * Vector3.forward).normalized;
foreach (var locator in _liveTimelineControl.liveCharactorLocators)
{
if (locator != null && updateInfo.flags.hasFlag(locator.liveCharaStandingPosition) && locator is LiveTimelineCharaLocator charaLocator)
{
var container = charaLocator.UmaContainer;
if (container)
{
MaterialPropertyBlock propertyBlock = new MaterialPropertyBlock();
propertyBlock.SetFloat("_RimShadowRate", updateInfo.globalRimShadowRate);
propertyBlock.SetColor("_RimColor", updateInfo.rimColor);
propertyBlock.SetFloat("_RimStep", updateInfo.rimStep);
propertyBlock.SetFloat("_RimFeather", updateInfo.rimFeather);
propertyBlock.SetFloat("_RimSpecRate", updateInfo.rimSpecRate);
propertyBlock.SetFloat("_RimHorizonOffset", updateInfo.RimHorizonOffset);
propertyBlock.SetFloat("_RimVerticalOffset", updateInfo.RimVerticalOffset);
propertyBlock.SetFloat("_RimHorizonOffset2", updateInfo.RimHorizonOffset2);
propertyBlock.SetFloat("_RimVerticalOffset2", updateInfo.RimVerticalOffset2);
propertyBlock.SetColor("_RimColor2", updateInfo.rimColor2);
propertyBlock.SetFloat("_RimStep2", updateInfo.rimStep2);
propertyBlock.SetFloat("_RimFeather2", updateInfo.rimFeather2);
propertyBlock.SetFloat("_RimSpecRate2", updateInfo.rimSpecRate2);
propertyBlock.SetFloat("_RimShadowRate2", updateInfo.globalRimShadowRate2);
foreach (var renderer in container.Renderers)
{
renderer.SetPropertyBlock(propertyBlock);
foreach(var mat in renderer.materials)
{
mat.SetFloat("_UseOriginalDirectionalLight", 1);
mat.SetVector("_OriginalDirectionalLightDir", tmpPos);
}
}
}
}
}
};
_liveTimelineControl.OnUpdateBgColor1 += delegate (ref BgColor1UpdateInfo updateInfo)
{
foreach (var locator in _liveTimelineControl.liveCharactorLocators)
{
var EFlags = (LiveCharaPositionFlag)updateInfo.flags;
if (locator != null && (updateInfo.flags == 0 || EFlags.hasFlag(locator.liveCharaStandingPosition)) && locator is LiveTimelineCharaLocator charaLocator)
{
var container = charaLocator.UmaContainer;
if (container)
{
MaterialPropertyBlock propertyBlock = new MaterialPropertyBlock();
propertyBlock.SetColor("_CharaColor", updateInfo.color);
propertyBlock.SetColor("_ToonDarkColor", updateInfo.toonDarkColor);
propertyBlock.SetColor("_ToonBrightColor", updateInfo.toonBrightColor);
propertyBlock.SetColor("_OutlineColor", updateInfo.outlineColor);
propertyBlock.SetFloat("_Saturation", updateInfo.Saturation);
foreach (var renderer in container.Renderers)
{
renderer.SetPropertyBlock(propertyBlock);
}
}
}
}
};
SetupCharacterLocator();
InitializeCamera();
UpdateMainCamera();
@@ -284,6 +351,7 @@ namespace Gallop.Live
{
var container = CharaContainerScript[i];
container.LiveLocator = new LiveTimelineCharaLocator(container);
container.LiveLocator.liveCharaStandingPosition = (LiveCharaPosition)i;
_liveTimelineControl.liveCharactorLocators[i] = container.LiveLocator;
container.LiveLocator.liveCharaInitialPosition = container.transform.position;
}