Live: add monitors, cyalumes, and skirt collision tuning
This commit is contained in:
@@ -78,6 +78,19 @@ namespace Gallop.Live.Cutt
|
||||
public event Action<LiveTimelineChromaticAberrationData, LiveTimelineKeyChromaticAberrationData> OnUpdateChromaticAberration;
|
||||
public event Action<LiveTimelineHdrBloomData, LiveTimelineKeyHdrBloomData> OnUpdateHdrBloom;
|
||||
public event Action<LiveTimelineColorCorrectionData, LiveTimelineKeyColorCorrectionData> OnUpdateColorCorrection;
|
||||
public event MobCyalumeUpdateInfoDelegate OnUpdateMobControl;
|
||||
public event MobCyalumeUpdateInfoDelegate OnUpdateCyalumeControl;
|
||||
public event Action<LiveTimelineMonitorControlData, LiveTimelineKeyMonitorControlData> OnUpdateMonitorControl;
|
||||
public event Action<LiveTimelineMonitorCameraPositionData, LiveTimelineKeyMonitorCameraPositionData> OnUpdateMonitorCameraPosition;
|
||||
public event Action<LiveTimelineMonitorCameraLookAtData, LiveTimelineKeyMonitorCameraLookAtData> OnUpdateMonitorCameraLookAt;
|
||||
public event Action<LiveTimelineLensFlareData, LiveTimelineKeyLensFlareData> OnUpdateLensFlare;
|
||||
public event Action<LiveTimelineStageEnvironmentData, LiveTimelineKeyStageEnvironmentData> OnUpdateEnvironment;
|
||||
public event Action<int, LiveTimelineKeyFacialToonData> OnUpdateFacialToon;
|
||||
public event Action<LiveTimelinePropsData, LiveTimelineKeyPropsData> OnUpdateProps;
|
||||
public event Action<LiveTimelinePropsAttachData, LiveTimelineKeyPropsAttachData> OnUpdatePropsAttach;
|
||||
public event Action<LiveTimelineKeyCharaFootLightData> OnUpdateCharaFootLight;
|
||||
public event Action<LiveTimelineAdditionalLight, LiveTimelineKeyData_AdditionalLight> OnUpdateAdditionalLight;
|
||||
public event Action<LiveTimelineLightProjectionData, LiveTimelineKeyLightProjectionData> OnUpdateLightProjection;
|
||||
|
||||
private static Func<LiveTimelineKeyCameraPositionData, LiveTimelineControl, FindTimelineConfig, Vector3> fnGetCameraPosValue = GetCameraPosValue;
|
||||
|
||||
@@ -210,6 +223,7 @@ namespace Gallop.Live.Cutt
|
||||
private Vector3 _liveStageCenterPos = Vector3.zero;
|
||||
|
||||
private TimelinePlayerMode _playMode = TimelinePlayerMode.Default;
|
||||
public TimelinePlayerMode PlayMode => _playMode;
|
||||
|
||||
public static int liveCharaPositionMax
|
||||
{
|
||||
@@ -382,6 +396,19 @@ namespace Gallop.Live.Cutt
|
||||
// 分发保留,接上只需订阅 OnUpdateHdrBloom。
|
||||
AlterUpdate_SimpleListControl(workSheet.hdrBloomKeys, d => d.keys, OnUpdateHdrBloom, _currentFrame);
|
||||
AlterUpdate_SimpleListControl(workSheet.colorCorrectionDataLists, d => d.keys, OnUpdateColorCorrection, _currentFrame);
|
||||
AlterUpdate_MobCyalumeControl(workSheet.MobControlKeys, _currentFrame, OnUpdateMobControl);
|
||||
AlterUpdate_MobCyalumeControl(workSheet.CyalumeControlKeys, _currentFrame, OnUpdateCyalumeControl);
|
||||
AlterUpdate_SimpleListControl(workSheet.monitorControlList, d => d.keys, OnUpdateMonitorControl, _currentFrame);
|
||||
AlterUpdate_SimpleListControl(workSheet.monitorCameraPosKeys, d => d.keys, OnUpdateMonitorCameraPosition, _currentFrame);
|
||||
AlterUpdate_SimpleListControl(workSheet.monitorCameraLookAtKeys, d => d.keys, OnUpdateMonitorCameraLookAt, _currentFrame);
|
||||
AlterUpdate_SimpleListControl(workSheet.lensFlareList, d => d.keys, OnUpdateLensFlare, _currentFrame);
|
||||
AlterUpdate_SimpleListControl(workSheet.environmentDataLists, d => d.keys, OnUpdateEnvironment, _currentFrame);
|
||||
AlterUpdate_FacialToon(workSheet.facialToonSet, _currentFrame);
|
||||
AlterUpdate_SimpleListControl(workSheet.propsList, d => d.keys, OnUpdateProps, _currentFrame);
|
||||
AlterUpdate_SimpleListControl(workSheet.propsAttachList, d => d.keys, OnUpdatePropsAttach, _currentFrame);
|
||||
AlterUpdate_SimpleListControl(workSheet.AdditionalLightList, d => d.keys, OnUpdateAdditionalLight, _currentFrame);
|
||||
AlterUpdate_CharaFootLight(workSheet.charaFootLightKeys, _currentFrame);
|
||||
AlterUpdate_SimpleListControl(workSheet.lightProjectionList, d => d.keys, OnUpdateLightProjection, _currentFrame);
|
||||
AlterUpdate_PostFilm(workSheet.postFilmKeys, 0, _currentFrame);
|
||||
AlterUpdate_PostFilm(workSheet.postFilm2Keys, 1, _currentFrame);
|
||||
AlterUpdate_PostFilm(workSheet.postFilm3Keys, 2, _currentFrame);
|
||||
@@ -609,9 +636,14 @@ namespace Gallop.Live.Cutt
|
||||
{
|
||||
|
||||
var formationList = data.worksheetList[0].formationOffsetSet.Init();
|
||||
if (formationList == null)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < Director.instance.characterCount; i++)
|
||||
int count = Mathf.Min(Director.instance.characterCount, formationList.Count);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (formationList[i] == null)
|
||||
continue;
|
||||
LiveTimelineKeyIndex curKey = AlterUpdate_Key(formationList[i], liveTime);
|
||||
|
||||
if (curKey != null && curKey.index != -1)
|
||||
@@ -2015,6 +2047,72 @@ namespace Gallop.Live.Cutt
|
||||
}
|
||||
}
|
||||
|
||||
private void AlterUpdate_MobCyalumeControl(
|
||||
List<LiveTimelineMobCyalumeControlData> dataList,
|
||||
float currentFrame,
|
||||
MobCyalumeUpdateInfoDelegate callback)
|
||||
{
|
||||
if (callback == null || dataList == null) return;
|
||||
|
||||
for (int i = 0; i < dataList.Count; i++)
|
||||
{
|
||||
var data = dataList[i];
|
||||
var keys = data != null ? data.keys : null;
|
||||
if (keys == null || keys.Count == 0 || keys.HasAttribute(LiveTimelineKeyDataListAttr.Disable) ||
|
||||
!keys.EnablePlayModeTimeline(_playMode)) continue;
|
||||
|
||||
FindTimelineKey(out var curKey, out var nextKey, keys, currentFrame);
|
||||
var current = curKey as LiveTimelineKeyMobCyalumeControlData;
|
||||
var next = nextKey as LiveTimelineKeyMobCyalumeControlData;
|
||||
if (current == null) continue;
|
||||
|
||||
var info = new MobCyalumeUpdateInfo
|
||||
{
|
||||
data = data,
|
||||
unk0 = (uint)keys.unk48 < 11u ? keys.unk48 : i,
|
||||
currentFrame = currentFrame,
|
||||
currentLiveTime = currentLiveTime
|
||||
};
|
||||
|
||||
if (next != null && next.interpolateType != LiveCameraInterpolateType.None)
|
||||
{
|
||||
float t = CalculateInterpolationValue(current, next, currentFrame);
|
||||
info.position = Vector3.Lerp(current.position, next.position, t);
|
||||
info.rotation = Quaternion.Lerp(current.GetRotation(), next.GetRotation(), t);
|
||||
info.scale = Vector3.Lerp(current.scale, next.scale, t);
|
||||
}
|
||||
else
|
||||
{
|
||||
info.position = current.position;
|
||||
info.rotation = current.GetRotation();
|
||||
info.scale = current.scale;
|
||||
}
|
||||
|
||||
callback.Invoke(ref info);
|
||||
}
|
||||
}
|
||||
|
||||
private void AlterUpdate_FacialToon(LiveTimelineFacialToonData data, float currentFrame)
|
||||
{
|
||||
if (data == null || OnUpdateFacialToon == null) return;
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
var keys = data.GetKeys(i);
|
||||
if (keys == null || keys.Count == 0 || keys.HasAttribute(LiveTimelineKeyDataListAttr.Disable) ||
|
||||
!keys.EnablePlayModeTimeline(_playMode)) continue;
|
||||
FindTimelineKey(out var current, out var _, keys, currentFrame);
|
||||
if (current is LiveTimelineKeyFacialToonData key) OnUpdateFacialToon.Invoke(i, key);
|
||||
}
|
||||
}
|
||||
|
||||
private void AlterUpdate_CharaFootLight(LiveTimelineKeyCharaFootLightDataList keys, float currentFrame)
|
||||
{
|
||||
if (keys == null || OnUpdateCharaFootLight == null || keys.Count == 0 ||
|
||||
keys.HasAttribute(LiveTimelineKeyDataListAttr.Disable) || !keys.EnablePlayModeTimeline(_playMode)) return;
|
||||
FindTimelineKey(out var current, out var _, keys, currentFrame);
|
||||
if (current is LiveTimelineKeyCharaFootLightData key) OnUpdateCharaFootLight.Invoke(key);
|
||||
}
|
||||
|
||||
private void AlterUpdate_GlobalFogControl(LiveTimelineWorkSheet sheet, float currentFrame)
|
||||
{
|
||||
if (sheet.globalFogDataLists == null || OnUpdateGlobalFog == null) return;
|
||||
@@ -2070,4 +2168,3 @@ namespace Gallop.Live.Cutt
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
+311
@@ -0,0 +1,311 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Gallop.Live.Cutt
|
||||
{
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyLensFlareData : LiveTimelineKeyWithInterpolate
|
||||
{
|
||||
public Vector3 offset;
|
||||
public Color color = Color.white;
|
||||
public float brightness = 1f;
|
||||
public float fadeSpeed = 1f;
|
||||
public int enableParameter;
|
||||
public int enableFlare;
|
||||
public int IsAutoBrightness;
|
||||
public int IsOverridePosition;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyLensFlareDataList : LiveTimelineKeyDataListTemplate<LiveTimelineKeyLensFlareData> { }
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineLensFlareData : ILiveTimelineGroupDataWithName
|
||||
{
|
||||
public LiveTimelineKeyLensFlareDataList keys;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyStageEnvironmentData : LiveTimelineKey
|
||||
{
|
||||
public bool isValidMirror;
|
||||
public bool isMirror;
|
||||
public bool isBgMirror;
|
||||
public bool IsMirrorBg3d;
|
||||
public bool EnableCharacterMirrorExpandFaceBounds;
|
||||
public int characterMirror;
|
||||
public int CharacterMirrorHead;
|
||||
public int CharacterMirrorExpandFaceBounds;
|
||||
public float mirrorReflectionRate = 1f;
|
||||
public bool isValidShadow;
|
||||
public int characterShadow;
|
||||
public bool isSoftShadow;
|
||||
public bool IsToonMirror;
|
||||
public bool isValidWaterReflection;
|
||||
public float waterReflection;
|
||||
public float waveScale;
|
||||
public float waterDistortion;
|
||||
public float waterUCross;
|
||||
public float waterVCross;
|
||||
public float waterUSpeed;
|
||||
public float waterVSpeed;
|
||||
public float waterNormalPower;
|
||||
public float waveDistortionPower;
|
||||
public float waveClearly;
|
||||
public float waveDiffusion;
|
||||
public float waveDecline;
|
||||
public Color waterColor;
|
||||
public float waterVOffset;
|
||||
public bool IsValidStageFovShift;
|
||||
public float BaseFov;
|
||||
public float ShiftPower;
|
||||
public bool IsShiftY;
|
||||
public bool _isValidMirror;
|
||||
public int _mirror;
|
||||
public int _bgMirror;
|
||||
public int _characterMirror;
|
||||
public float _mirrorReflectionRate = -1f;
|
||||
|
||||
public bool MirrorIsValid => isValidMirror || _isValidMirror;
|
||||
public bool MirrorEnabled => isMirror || isBgMirror || IsMirrorBg3d || _mirror != 0 || _bgMirror != 0;
|
||||
public float ReflectionRate => _mirrorReflectionRate >= 0f ? _mirrorReflectionRate : mirrorReflectionRate;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyStageEnvironmentDataList : LiveTimelineKeyDataListTemplate<LiveTimelineKeyStageEnvironmentData> { }
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineStageEnvironmentData : ILiveTimelineGroupDataWithName
|
||||
{
|
||||
public LiveTimelineKeyStageEnvironmentDataList keys;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyFacialToonData : LiveTimelineKeyWithInterpolate
|
||||
{
|
||||
public float CheekPretenseThreshold;
|
||||
public float NosePretenseThreshold;
|
||||
public float CylinderBlend;
|
||||
public float HairNormalBlend;
|
||||
public int UseOriginalDirectionalLight;
|
||||
public Vector3 OriginalDirectionalLightDir;
|
||||
public float EyeToonStep;
|
||||
public float EyeToonFeather;
|
||||
public float EyeSaturation;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyFacialToonDataList : LiveTimelineKeyDataListTemplate<LiveTimelineKeyFacialToonData> { }
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineFacialToonData
|
||||
{
|
||||
public LiveTimelineKeyFacialToonDataList centerKeys;
|
||||
public LiveTimelineKeyFacialToonDataList left1Keys;
|
||||
public LiveTimelineKeyFacialToonDataList right1Keys;
|
||||
public LiveTimelineKeyFacialToonDataList left2Keys;
|
||||
public LiveTimelineKeyFacialToonDataList right2Keys;
|
||||
public LiveTimelineKeyFacialToonDataList motion5Keys;
|
||||
public LiveTimelineKeyFacialToonDataList motion6Keys;
|
||||
public LiveTimelineKeyFacialToonDataList motion7Keys;
|
||||
public LiveTimelineKeyFacialToonDataList motion8Keys;
|
||||
public LiveTimelineKeyFacialToonDataList motion9Keys;
|
||||
public LiveTimelineKeyFacialToonDataList motion10Keys;
|
||||
public LiveTimelineKeyFacialToonDataList motion11Keys;
|
||||
public LiveTimelineKeyFacialToonDataList motion12Keys;
|
||||
public LiveTimelineKeyFacialToonDataList motion13Keys;
|
||||
public LiveTimelineKeyFacialToonDataList motion14Keys;
|
||||
public LiveTimelineKeyFacialToonDataList motion15Keys;
|
||||
public LiveTimelineKeyFacialToonDataList motion16Keys;
|
||||
public LiveTimelineKeyFacialToonDataList motion17Keys;
|
||||
public LiveTimelineKeyFacialToonDataList motion18Keys;
|
||||
public LiveTimelineKeyFacialToonDataList motion19Keys;
|
||||
|
||||
public LiveTimelineKeyFacialToonDataList GetKeys(int index)
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0: return centerKeys; case 1: return left1Keys; case 2: return right1Keys;
|
||||
case 3: return left2Keys; case 4: return right2Keys; case 5: return motion5Keys;
|
||||
case 6: return motion6Keys; case 7: return motion7Keys; case 8: return motion8Keys;
|
||||
case 9: return motion9Keys; case 10: return motion10Keys; case 11: return motion11Keys;
|
||||
case 12: return motion12Keys; case 13: return motion13Keys; case 14: return motion14Keys;
|
||||
case 15: return motion15Keys; case 16: return motion16Keys; case 17: return motion17Keys;
|
||||
case 18: return motion18Keys; case 19: return motion19Keys; default: return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyCameraLayerData : LiveTimelineKeyWithInterpolate
|
||||
{
|
||||
public Vector3 offsetMaxPosition;
|
||||
public Vector3 offsetMinPosition;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyCameraLayerDataList : LiveTimelineKeyDataListTemplate<LiveTimelineKeyCameraLayerData> { }
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyPropsData : LiveTimelineKeyWithInterpolate
|
||||
{
|
||||
public int settingFlags;
|
||||
public int propsID;
|
||||
public int rendererEnable;
|
||||
public int IsVisibleAttachedCharaLinked;
|
||||
public int AutoSwitchLayerOnMirrorRendering;
|
||||
public Color color = Color.white;
|
||||
public Color rootColor = Color.white;
|
||||
public Color tipColor = Color.white;
|
||||
public float colorPower = 1f;
|
||||
public int IsApplyAnimation;
|
||||
public int IsApplyReserveWarming;
|
||||
public AnimationClip AnimationClip;
|
||||
public float StartAnimationTime;
|
||||
public int AnimationHeadFrame;
|
||||
public Color ToonDarkColor;
|
||||
public Color ToonBrightColor;
|
||||
public int IsCastShadow;
|
||||
public int IsCastShadowForced;
|
||||
public Vector3 _directionalLightAngle;
|
||||
public int IsUpdateOutline;
|
||||
public float OutlineWidth;
|
||||
public Color OutlineColor;
|
||||
public int IsEmissive;
|
||||
public Color EmissiveColor;
|
||||
public float EmissiveScrollTimeScale = 1f;
|
||||
public float EmissiveScrollEnergyScale = 1f;
|
||||
}
|
||||
|
||||
[Serializable] public class LiveTimelineKeyPropsDataList : LiveTimelineKeyDataListTemplate<LiveTimelineKeyPropsData> { }
|
||||
[Serializable]
|
||||
public class LiveTimelinePropsData : ILiveTimelineGroupDataWithName
|
||||
{
|
||||
public LiveTimelineKeyPropsDataList keys;
|
||||
public bool _applyVariation;
|
||||
public int _variationId;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyPropsAttachData : LiveTimelineKeyWithInterpolate
|
||||
{
|
||||
public string _attachJointName;
|
||||
public int _attachJointHash;
|
||||
public string _copyPositionJointName;
|
||||
public int _copyPositionJointHash;
|
||||
public int _settingFlags;
|
||||
public int _propsId;
|
||||
public Vector3 _offsetPosition;
|
||||
public Vector3 OffsetRotate;
|
||||
public Vector3 OffsetScale = Vector3.one;
|
||||
public int IsLinkAttachBone;
|
||||
public int _attachType;
|
||||
public int _attachPropId = -1;
|
||||
public string _attachTargetPropNodeName;
|
||||
}
|
||||
|
||||
[Serializable] public class LiveTimelineKeyPropsAttachDataList : LiveTimelineKeyDataListTemplate<LiveTimelineKeyPropsAttachData> { }
|
||||
[Serializable]
|
||||
public class LiveTimelinePropsAttachData : ILiveTimelineGroupDataWithName
|
||||
{
|
||||
public LiveTimelineKeyPropsAttachDataList keys;
|
||||
public bool _applyVariation;
|
||||
public int _variationId;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyCharaFootLightData : LiveTimelineKeyWithInterpolate
|
||||
{
|
||||
public int positionFlag;
|
||||
public float[] hightMax = Array.Empty<float>();
|
||||
public Color[] lightColor = Array.Empty<Color>();
|
||||
public int[] LightBlendModeArray = Array.Empty<int>();
|
||||
public int[] EasingArray = Array.Empty<int>();
|
||||
}
|
||||
|
||||
[Serializable] public class LiveTimelineKeyCharaFootLightDataList : LiveTimelineKeyDataListTemplate<LiveTimelineKeyCharaFootLightData> { }
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyData_AdditionalLight : LiveTimelineKeyWithInterpolate
|
||||
{
|
||||
public Vector3 Position;
|
||||
public Vector3 Rotate;
|
||||
public int IsEnable;
|
||||
public int Type;
|
||||
public float Range;
|
||||
public int SpotAngle;
|
||||
public int IndirectMultiplier;
|
||||
public int ShadowType;
|
||||
public float Strength = 1f;
|
||||
public float Bias = 0.05f;
|
||||
public float NormalBias = 0.4f;
|
||||
public float NearPlane = 0.2f;
|
||||
}
|
||||
|
||||
[Serializable] public class LiveTimelineKeyAdditionalLightList : LiveTimelineKeyDataListTemplate<LiveTimelineKeyData_AdditionalLight> { }
|
||||
[Serializable]
|
||||
public class LiveTimelineAdditionalLight : ILiveTimelineGroupDataWithName
|
||||
{
|
||||
public LiveTimelineKeyAdditionalLightList keys;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineLightProjectionAnimationParam
|
||||
{
|
||||
public int TextureId = -1;
|
||||
public int DivisionNumberX;
|
||||
public int DivisionNumberY;
|
||||
public int MaxCut;
|
||||
public float AnimationTime;
|
||||
public Vector2 ScaleUV = Vector2.one;
|
||||
public Vector2 OffsetUV;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyLightProjectionData : LiveTimelineKeyWithInterpolate
|
||||
{
|
||||
public int IsEnable;
|
||||
public int OverrideIgnoreLayer;
|
||||
public LayerMask OverrideLayerMask;
|
||||
public int BacksideOff;
|
||||
public float MirrorBallBacksideFeather;
|
||||
public int ProjectionToCharacterModelOnly;
|
||||
public int TextureId;
|
||||
public Color Color = Color.white;
|
||||
public Vector3 Position;
|
||||
public Vector3 Angle;
|
||||
public Vector3 Scale = Vector3.one;
|
||||
public int Orthographic;
|
||||
public float OrthographicSize = 10f;
|
||||
public float NearClipPlane = 0.1f;
|
||||
public float FarClipPlane = 100f;
|
||||
public float FieldOfView = 60f;
|
||||
public float ColorPower = 1f;
|
||||
public int LightBlendMode;
|
||||
public int CharacterAttach;
|
||||
public int CharacterAttachPosition;
|
||||
public string BlinkLightName;
|
||||
public int BlinkLightNameHash;
|
||||
public int BlinkLightContainerIndex;
|
||||
public float BlinkLightBrightnessPower = 1f;
|
||||
public int IsAdjustedBlinkLightColor;
|
||||
public Vector3 MirrorBallRotateAxis = Vector3.up;
|
||||
public float MirrorBallRotateValue;
|
||||
public float MirrorBallProjectionRadius = 20f;
|
||||
public float MirrorBallFallOffPower = 2f;
|
||||
public int MirrorBallIsLoopRotation;
|
||||
public float MirrorBallLoopRotationSpeed;
|
||||
public Vector2 MirrorBallUVOffset;
|
||||
public Vector2 MirrorBallUVScale = Vector2.one;
|
||||
public int MirrorBallUseCubeMap;
|
||||
public LiveTimelineLightProjectionAnimationParam AnimationParam;
|
||||
}
|
||||
|
||||
[Serializable] public class LiveTimelineKeyLightProjectionDataList : LiveTimelineKeyDataListTemplate<LiveTimelineKeyLightProjectionData> { }
|
||||
[Serializable]
|
||||
public class LiveTimelineLightProjectionData : ILiveTimelineGroupDataWithName
|
||||
{
|
||||
public LiveTimelineKeyLightProjectionDataList keys;
|
||||
public int ContentType;
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7ae1a98a234410e4d87de597cb89e723
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Gallop.Live.Cutt
|
||||
{
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyMobCyalumeControlData : LiveTimelineKeyWithInterpolate
|
||||
{
|
||||
public Vector3 position;
|
||||
public Vector3 angle;
|
||||
public Vector3 scale = Vector3.one;
|
||||
|
||||
[NonSerialized] private Quaternion _rotationCache = Quaternion.identity;
|
||||
[NonSerialized] private bool _hasRotationCache;
|
||||
|
||||
public Quaternion GetRotation()
|
||||
{
|
||||
if (!_hasRotationCache)
|
||||
{
|
||||
_rotationCache = Quaternion.Euler(angle);
|
||||
_hasRotationCache = true;
|
||||
}
|
||||
|
||||
return _rotationCache;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyMobCyalumeControlDataList : LiveTimelineKeyDataListTemplate<LiveTimelineKeyMobCyalumeControlData>
|
||||
{
|
||||
public int unk48;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineMobCyalumeControlData : ILiveTimelineGroupDataWithName
|
||||
{
|
||||
public LiveTimelineKeyMobCyalumeControlDataList keys;
|
||||
}
|
||||
|
||||
public delegate void MobCyalumeUpdateInfoDelegate(ref MobCyalumeUpdateInfo updateInfo);
|
||||
|
||||
public struct MobCyalumeUpdateInfo
|
||||
{
|
||||
public LiveTimelineMobCyalumeControlData data;
|
||||
public int unk0;
|
||||
public Vector3 position;
|
||||
public Quaternion rotation;
|
||||
public Vector3 scale;
|
||||
public float currentFrame;
|
||||
public float currentLiveTime;
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 280ab9377b79c584084b467f575dcf5e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Gallop.Live.Cutt
|
||||
{
|
||||
[Serializable]
|
||||
public class LiveTimelineMonitorDressCondition
|
||||
{
|
||||
public int IsCheck;
|
||||
public int CharaId;
|
||||
public int DressId;
|
||||
public bool IsEnabled => IsCheck != 0;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineMonitorChangeUVSetting
|
||||
{
|
||||
public int IsChangeUVSetting;
|
||||
public int DispID = -1;
|
||||
public LiveTimelineMonitorDressCondition[] ConditionArray = Array.Empty<LiveTimelineMonitorDressCondition>();
|
||||
public bool IsEnabled => IsChangeUVSetting != 0;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyMonitorControlData : LiveTimelineKeyWithInterpolate
|
||||
{
|
||||
public Vector2 position;
|
||||
public Vector2 size = Vector2.one;
|
||||
public int dispID;
|
||||
public float speed = 1f;
|
||||
public string outputTextureLabel = string.Empty;
|
||||
public int playStartOffsetFrame;
|
||||
public float blendFactor = 1f;
|
||||
public Color colorFade = Color.clear;
|
||||
public Color BaseColor = Color.clear;
|
||||
public int SrcBlendMode = 1;
|
||||
public int DstBlendMode;
|
||||
public int RenderQueueNo = 2000;
|
||||
public int IsRenderQueue;
|
||||
public int DispID2 = -1;
|
||||
public float CrossFadeRate;
|
||||
public int LightImageNo;
|
||||
public int LightImageNo2;
|
||||
public float FilterTexScale = 1f;
|
||||
public LiveTimelineMonitorChangeUVSetting[] ChangeUVSettingArray = Array.Empty<LiveTimelineMonitorChangeUVSetting>();
|
||||
public int extraContent;
|
||||
|
||||
private const int AttrMulti = 65536;
|
||||
private const int AttrPlayReverse = 131072;
|
||||
private const int AttrUseMonitorCamera = 262144;
|
||||
private const int AttrForcedUseMonitorCamera = 524288;
|
||||
private const int AttrEnableBlendMode = 1048576;
|
||||
|
||||
public bool IsMultiFlag() => (((int)attribute) & AttrMulti) != 0;
|
||||
public bool IsReversePlayFlag() => (((int)attribute) & AttrPlayReverse) != 0;
|
||||
public bool IsMonitorCameraFlag() => (((int)attribute) & AttrUseMonitorCamera) != 0;
|
||||
public bool IsForcedUseMonitorCamera => (((int)attribute) & AttrForcedUseMonitorCamera) != 0;
|
||||
public bool IsEnabledBlendMode => (((int)attribute) & AttrEnableBlendMode) != 0;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyMonitorControlDataList : LiveTimelineKeyDataListTemplate<LiveTimelineKeyMonitorControlData> { }
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineMonitorControlData : ILiveTimelineGroupDataWithName
|
||||
{
|
||||
public LiveTimelineKeyMonitorControlDataList keys;
|
||||
public string SafeName => string.IsNullOrWhiteSpace(name) ? "Monitor" : name;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyMonitorCameraPositionData : LiveTimelineKeyCameraPositionData { }
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyMonitorCameraPositionDataList : LiveTimelineKeyDataListTemplate<LiveTimelineKeyMonitorCameraPositionData> { }
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineMonitorCameraPositionData : ILiveTimelineGroupDataWithName
|
||||
{
|
||||
public LiveTimelineKeyMonitorCameraPositionDataList keys;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyMonitorCameraLookAtData : LiveTimelineKeyCameraLookAtData { }
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyMonitorCameraLookAtDataList : LiveTimelineKeyDataListTemplate<LiveTimelineKeyMonitorCameraLookAtData> { }
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineMonitorCameraLookAtData : ILiveTimelineGroupDataWithName
|
||||
{
|
||||
public LiveTimelineKeyMonitorCameraLookAtDataList keys;
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cfdc8a520019e8544b2904b4954b6182
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -952,6 +952,22 @@ namespace Gallop.Live.Cutt
|
||||
[SerializeField] public List<LiveTimelineHdrBloomData> hdrBloomKeys;
|
||||
[SerializeField] public List<LiveTimelineColorCorrectionData> colorCorrectionDataLists;
|
||||
|
||||
// Names verified against the cutt TypeTree. The capital letters are required for Unity deserialization.
|
||||
[SerializeField] public List<LiveTimelineMobCyalumeControlData> MobControlKeys;
|
||||
[SerializeField] public List<LiveTimelineMobCyalumeControlData> CyalumeControlKeys;
|
||||
[SerializeField] public List<LiveTimelineMonitorControlData> monitorControlList;
|
||||
[SerializeField] public List<LiveTimelineMonitorCameraPositionData> monitorCameraPosKeys;
|
||||
[SerializeField] public List<LiveTimelineMonitorCameraLookAtData> monitorCameraLookAtKeys;
|
||||
[SerializeField] public List<LiveTimelineLensFlareData> lensFlareList;
|
||||
[SerializeField] public List<LiveTimelineStageEnvironmentData> environmentDataLists;
|
||||
[SerializeField] public LiveTimelineFacialToonData facialToonSet;
|
||||
[SerializeField] public LiveTimelineKeyCameraLayerDataList cameraLayerKeys;
|
||||
[SerializeField] public List<LiveTimelinePropsData> propsList;
|
||||
[SerializeField] public List<LiveTimelinePropsAttachData> propsAttachList;
|
||||
[SerializeField] public LiveTimelineKeyCharaFootLightDataList charaFootLightKeys;
|
||||
[SerializeField] public List<LiveTimelineAdditionalLight> AdditionalLightList;
|
||||
[SerializeField] public List<LiveTimelineLightProjectionData> lightProjectionList;
|
||||
|
||||
// PostFilm (39):全语料 ~20200 keys / 59 首,是未实现轨道里数据量最大的一块。
|
||||
// 旧扫描把它记成「58/58 首存在但全部 0 keyframe(空占位)」,实测是错的
|
||||
// (song 1177 分别有 100 / 161 / 87 keys)。字段名取自 bundle TypeTree。
|
||||
@@ -1039,4 +1055,3 @@ namespace Gallop.Live.Cutt
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
using UnityEngine;
|
||||
|
||||
// Compatibility component for scenes authored with the master4 helper. Runtime setup is now
|
||||
// owned by Director.InitializeCyalumeStage, so this type intentionally has no behavior.
|
||||
[DisallowMultipleComponent]
|
||||
public sealed class CyalumeAutoBinder : MonoBehaviour
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 76a8f506f7e580449b2e8dee47ca1120
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,55 +1,524 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Gallop.Cyalume;
|
||||
using Gallop.Live.Cutt;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Gallop.Live.Cyalume
|
||||
{
|
||||
|
||||
[DisallowMultipleComponent]
|
||||
public class CyalumeController3D : CyalumeControllerBase
|
||||
{
|
||||
float passedtime = 0.0f;
|
||||
float intervaltime = 0.033333333f;
|
||||
float y_offset = 0.0f;
|
||||
GameObject CyalumeObj;
|
||||
Material CyalumeMaterial;
|
||||
private void Awake()
|
||||
[SerializeField] private bool _initializedObjects;
|
||||
[SerializeField] private bool _autoSetupOnStart;
|
||||
[SerializeField] private float _forceReplaceWarmupSeconds = 1.5f;
|
||||
|
||||
private readonly List<Renderer> _defaultRenderers = new List<Renderer>();
|
||||
private readonly List<Renderer> _randomRenderers = new List<Renderer>();
|
||||
|
||||
private GameObject _defaultInstance;
|
||||
private GameObject _randomInstance;
|
||||
private bool _usingRandomTarget;
|
||||
private Coroutine _setupCoroutine;
|
||||
private Coroutine _forceReplaceCoroutine;
|
||||
|
||||
[Header("Mob")]
|
||||
[SerializeField] private bool _enableMobController = true;
|
||||
[SerializeField] private string _mobPrefabName = "mob";
|
||||
[SerializeField] private GameObject _mobRootOverride;
|
||||
[SerializeField] private Color _mobColor = Color.white;
|
||||
[SerializeField] private Color _mobAmbientColor = Color.white;
|
||||
[SerializeField] private bool _mobVerboseLog;
|
||||
|
||||
private GameObject _mobInstance;
|
||||
private MobShadowController _mobShadowController;
|
||||
private LiveTimelineControl _mobTimelineControl;
|
||||
private readonly Vector3[] _mobPositions = new Vector3[11];
|
||||
private readonly Quaternion[] _mobRotations = new Quaternion[11];
|
||||
private readonly Vector3[] _mobScales = new Vector3[11];
|
||||
private readonly bool[] _mobDirtySlots = new bool[11];
|
||||
private bool _mobHasDirty;
|
||||
|
||||
public bool UsingRandomTarget => _usingRandomTarget;
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
InitializeCyalume();
|
||||
gameObject.GetComponent<CyalumeController3D>().enabled = true;
|
||||
|
||||
base.Awake();
|
||||
if (_autoSetupOnStart)
|
||||
InitializeCyalumeObjectsOnly();
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
private void Start()
|
||||
{
|
||||
if (CyalumeMaterial == null)
|
||||
if (_autoSetupOnStart)
|
||||
StartOfficialLikeSetup();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
TryBindGroupTimeline();
|
||||
MarkGroupMatrixDirty();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
UnbindGroupTimeline();
|
||||
}
|
||||
|
||||
public void StartOfficialLikeSetup(bool forceRebuild = false)
|
||||
{
|
||||
if (_setupCoroutine != null)
|
||||
{
|
||||
StopCoroutine(_setupCoroutine);
|
||||
_setupCoroutine = null;
|
||||
}
|
||||
|
||||
_setupCoroutine = StartCoroutine(SetupOfficialLike(forceRebuild));
|
||||
}
|
||||
|
||||
public IEnumerator SetupOfficialLike(bool forceRebuild = false)
|
||||
{
|
||||
ResetRuntimeState();
|
||||
InitializeCyalumeObjectsOnly(forceRebuild);
|
||||
|
||||
int musicId = ResolveMusicId();
|
||||
if (musicId <= 0)
|
||||
{
|
||||
Debug.LogWarning("[CyalumeController3D] musicId is unavailable.");
|
||||
yield break;
|
||||
}
|
||||
|
||||
var provider = ResolvePlaybackProvider();
|
||||
provider?.InitializeForMusicId(musicId);
|
||||
|
||||
string liveKey = CyalumePlaybackProvider.BuildPrimaryLiveKey(musicId);
|
||||
LoadTextureBundlesFromIndex(liveKey);
|
||||
|
||||
ApplyTargetSelection(false, true);
|
||||
EnsureCustomShaderOnCurrentTargets();
|
||||
CollectTargetMeshAndMaterials();
|
||||
CreateVertexColorCacheOfficialConservative();
|
||||
yield return null;
|
||||
|
||||
_textureSet.Clear();
|
||||
foreach (var pair in ResolveTexSetFromLoadedBundles(liveKey))
|
||||
_textureSet[pair.Key] = pair.Value;
|
||||
yield return null;
|
||||
|
||||
InitializeAudienceUvSpreadOfficialConservative();
|
||||
RefreshRendererEnabledState();
|
||||
_isInitialized = _targetRendererList.Count > 0 && _materialArray.Length > 0;
|
||||
ForceReplaceOfficialMaterialsInMemory();
|
||||
ForceReplaceCustomShaderInHierarchy(transform, true);
|
||||
ForceReplaceOfficialShaderAcrossLoadedScene();
|
||||
LogTargetShaderSummary("SetupOfficialLike");
|
||||
WriteCyalumeSceneSnapshot("SetupOfficialLike");
|
||||
|
||||
if (_verboseLog)
|
||||
{
|
||||
Debug.Log($"[CyalumeController3D] Setup complete. liveKey={liveKey}, targets={_targetRendererList.Count}, meshes={_meshFilters.Length}, materials={_materialArray.Length}, patterns={_textureSet.Count}");
|
||||
}
|
||||
|
||||
StartForceReplaceWarmup();
|
||||
_setupCoroutine = null;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
TryBindGroupTimeline();
|
||||
|
||||
if (!_isEnabledCyalume || !_initializedObjects || !_isInitialized)
|
||||
return;
|
||||
if (passedtime >= intervaltime)
|
||||
|
||||
if (!TryGetCurrentPlayback(out int patternId, out _, out _, out _, out _))
|
||||
return;
|
||||
|
||||
bool preferRandom = _playbackProvider != null && _playbackProvider.IsRandomPattern(patternId);
|
||||
bool targetChanged = ApplyTargetSelection(preferRandom);
|
||||
bool shaderChanged = EnsureCustomShaderOnCurrentTargets() > 0;
|
||||
bool memoryChanged = ForceReplaceOfficialMaterialsInMemory() > 0;
|
||||
if (targetChanged)
|
||||
{
|
||||
y_offset += (float)0.03125;
|
||||
if (y_offset >= 1.0f)
|
||||
{
|
||||
y_offset = 0.0f;
|
||||
}
|
||||
CyalumeMaterial.SetTextureOffset("_MainTex", new Vector2(0, y_offset));
|
||||
passedtime = 0;
|
||||
ForceReplaceOfficialMaterialsInMemory();
|
||||
ForceReplaceCustomShaderInHierarchy(transform, true);
|
||||
ForceReplaceOfficialShaderAcrossLoadedScene();
|
||||
CollectTargetMeshAndMaterials();
|
||||
CreateVertexColorCacheOfficialConservative();
|
||||
InitializeAudienceUvSpreadOfficialConservative();
|
||||
}
|
||||
passedtime += Time.fixedDeltaTime;
|
||||
else if (shaderChanged || memoryChanged)
|
||||
{
|
||||
CollectTargetMeshAndMaterials();
|
||||
ForceReplaceOfficialShaderAcrossLoadedScene();
|
||||
LogTargetShaderSummary(memoryChanged ? "ForceReplaceOfficialMaterialsInMemory" : "EnsureCustomShaderOnCurrentTargets");
|
||||
}
|
||||
|
||||
UpdateCyalumeOfficialConservative(false);
|
||||
}
|
||||
|
||||
public void InitializeCyalume()
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
AssetHolder CyalumeAssetHolder = gameObject.GetComponent<AssetHolder>();
|
||||
List<StringObjectPair> CyalumeObject = CyalumeAssetHolder._assetTable.list;
|
||||
foreach (StringObjectPair obj in CyalumeObject)
|
||||
TryBindGroupTimeline();
|
||||
FlushGroupMatrix();
|
||||
FlushMobShadowIfNeeded();
|
||||
}
|
||||
|
||||
private void StartForceReplaceWarmup()
|
||||
{
|
||||
if (_forceReplaceCoroutine != null)
|
||||
{
|
||||
GameObject tempObj = Instantiate((GameObject)obj.Value, transform);
|
||||
if (obj.Value.name.Contains("cyalume")){
|
||||
CyalumeObj = tempObj;
|
||||
CyalumeMaterial = gameObject.GetComponentInChildren<MeshRenderer>().material;
|
||||
StopCoroutine(_forceReplaceCoroutine);
|
||||
_forceReplaceCoroutine = null;
|
||||
}
|
||||
|
||||
if (_forceReplaceWarmupSeconds <= 0f)
|
||||
return;
|
||||
|
||||
_forceReplaceCoroutine = StartCoroutine(ForceReplaceWarmupCoroutine());
|
||||
}
|
||||
|
||||
private IEnumerator ForceReplaceWarmupCoroutine()
|
||||
{
|
||||
float endTime = Time.unscaledTime + _forceReplaceWarmupSeconds;
|
||||
while (Time.unscaledTime < endTime)
|
||||
{
|
||||
int replacedCount = 0;
|
||||
replacedCount += ForceReplaceOfficialMaterialsInMemory();
|
||||
replacedCount += ForceReplaceCustomShaderInHierarchy(transform, true);
|
||||
replacedCount += ForceReplaceOfficialShaderAcrossLoadedScene();
|
||||
if (replacedCount > 0)
|
||||
{
|
||||
CollectTargetMeshAndMaterials();
|
||||
LogTargetShaderSummary("ForceReplaceWarmup");
|
||||
WriteCyalumeSceneSnapshot("ForceReplaceWarmup");
|
||||
}
|
||||
|
||||
yield return null;
|
||||
}
|
||||
|
||||
_forceReplaceCoroutine = null;
|
||||
}
|
||||
|
||||
public override void InitializeCyalumeObjectsOnly(bool forceRebuild = false)
|
||||
{
|
||||
if (_initializedObjects && !forceRebuild)
|
||||
return;
|
||||
|
||||
_initializedObjects = false;
|
||||
_usingRandomTarget = false;
|
||||
_defaultInstance = null;
|
||||
_randomInstance = null;
|
||||
|
||||
_allRendererList.Clear();
|
||||
_targetRendererList.Clear();
|
||||
_defaultRenderers.Clear();
|
||||
_randomRenderers.Clear();
|
||||
|
||||
var assetHolder = GetComponent<AssetHolder>();
|
||||
if (assetHolder == null || assetHolder._assetTable == null)
|
||||
{
|
||||
Debug.LogWarning("[CyalumeController3D] AssetHolder or asset table is missing.");
|
||||
return;
|
||||
}
|
||||
|
||||
DestroyExistingCyalumeChildren();
|
||||
TryInstantiateNamedPrefab(assetHolder, "default", out _defaultInstance, _defaultRenderers);
|
||||
TryInstantiateNamedPrefab(assetHolder, "random", out _randomInstance, _randomRenderers);
|
||||
InitializeMobController(assetHolder);
|
||||
|
||||
_allRendererList.AddRange(_defaultRenderers);
|
||||
_allRendererList.AddRange(_randomRenderers);
|
||||
RefreshRendererEnabledState();
|
||||
|
||||
_initializedObjects = true;
|
||||
ApplyTargetSelection(false, true);
|
||||
}
|
||||
|
||||
public override bool ApplyTargetSelection(bool preferRandom, bool forceRefresh = false)
|
||||
{
|
||||
if (!_initializedObjects)
|
||||
{
|
||||
InitializeCyalumeObjectsOnly();
|
||||
if (!_initializedObjects)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool useRandom = preferRandom || _defaultRenderers.Count == 0;
|
||||
if (!useRandom && _defaultRenderers.Count == 0 && _randomRenderers.Count > 0)
|
||||
useRandom = true;
|
||||
|
||||
bool changed = forceRefresh || _usingRandomTarget != useRandom || _targetRendererList.Count == 0;
|
||||
_usingRandomTarget = useRandom;
|
||||
|
||||
_targetRendererList.Clear();
|
||||
if (_usingRandomTarget)
|
||||
_targetRendererList.AddRange(_randomRenderers.Count > 0 ? _randomRenderers : _defaultRenderers);
|
||||
else
|
||||
_targetRendererList.AddRange(_defaultRenderers.Count > 0 ? _defaultRenderers : _randomRenderers);
|
||||
|
||||
RefreshRendererEnabledState();
|
||||
|
||||
if (changed && _verboseLog)
|
||||
{
|
||||
Debug.Log($"[CyalumeController3D] Target selection -> {(_usingRandomTarget ? "random" : "default")}, count={_targetRendererList.Count}");
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
public bool ContainsTargetRenderer(Renderer renderer)
|
||||
{
|
||||
if (renderer == null)
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < _targetRendererList.Count; i++)
|
||||
{
|
||||
if (_targetRendererList[i] == renderer)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool ContainsAnyRenderer(Renderer renderer)
|
||||
{
|
||||
if (renderer == null)
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < _allRendererList.Count; i++)
|
||||
{
|
||||
if (_allRendererList[i] == renderer)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void TryBindGroupTimeline()
|
||||
{
|
||||
var director = Gallop.Live.Director.instance;
|
||||
if (director == null)
|
||||
return;
|
||||
|
||||
var timeline = director._liveTimelineControl;
|
||||
if (timeline == null || ReferenceEquals(_mobTimelineControl, timeline))
|
||||
return;
|
||||
|
||||
UnbindGroupTimeline();
|
||||
_mobTimelineControl = timeline;
|
||||
_mobTimelineControl.OnUpdateCyalumeControl += OnCyalumeControl;
|
||||
|
||||
if (_enableMobController)
|
||||
_mobTimelineControl.OnUpdateMobControl += OnMobControl;
|
||||
}
|
||||
|
||||
private void UnbindGroupTimeline()
|
||||
{
|
||||
if (_mobTimelineControl == null)
|
||||
return;
|
||||
|
||||
_mobTimelineControl.OnUpdateCyalumeControl -= OnCyalumeControl;
|
||||
_mobTimelineControl.OnUpdateMobControl -= OnMobControl;
|
||||
_mobTimelineControl = null;
|
||||
}
|
||||
|
||||
private void InitializeMobController(AssetHolder assetHolder)
|
||||
{
|
||||
_mobInstance = null;
|
||||
_mobShadowController = null;
|
||||
_mobHasDirty = false;
|
||||
Array.Clear(_mobDirtySlots, 0, _mobDirtySlots.Length);
|
||||
|
||||
if (!_enableMobController)
|
||||
return;
|
||||
|
||||
GameObject mobRoot = _mobRootOverride;
|
||||
if (!mobRoot && assetHolder != null && !string.IsNullOrEmpty(_mobPrefabName))
|
||||
{
|
||||
TryInstantiateNamedPrefab(assetHolder, _mobPrefabName, out _mobInstance, null);
|
||||
mobRoot = _mobInstance;
|
||||
}
|
||||
|
||||
if (!mobRoot)
|
||||
{
|
||||
if (_mobVerboseLog)
|
||||
Debug.LogWarning($"[CyalumeController3D] Mob root not found. prefabName='{_mobPrefabName}'");
|
||||
return;
|
||||
}
|
||||
|
||||
_mobShadowController = mobRoot.GetComponent<MobShadowController>();
|
||||
if (_mobShadowController == null)
|
||||
_mobShadowController = mobRoot.AddComponent<MobShadowController>();
|
||||
|
||||
_mobShadowController.Initialize(mobRoot);
|
||||
_mobShadowController.SetMobColor(_mobColor);
|
||||
_mobShadowController.SetAmbientColor(_mobAmbientColor);
|
||||
|
||||
if (_mobVerboseLog)
|
||||
Debug.Log($"[CyalumeController3D] Mob controller initialized on '{mobRoot.name}'.");
|
||||
}
|
||||
|
||||
private void OnCyalumeControl(ref MobCyalumeUpdateInfo info)
|
||||
{
|
||||
int index = ResolveGroupIndex(info);
|
||||
if ((uint)index >= 11u)
|
||||
return;
|
||||
|
||||
var position = info.position;
|
||||
var rotation = info.rotation;
|
||||
var scale = info.scale;
|
||||
SetGroupTRS(index, ref position, ref rotation, ref scale);
|
||||
}
|
||||
|
||||
private void OnMobControl(ref MobCyalumeUpdateInfo info)
|
||||
{
|
||||
int index = ResolveGroupIndex(info);
|
||||
if ((uint)index >= 11u)
|
||||
return;
|
||||
|
||||
_mobPositions[index] = info.position;
|
||||
_mobRotations[index] = info.rotation;
|
||||
_mobScales[index] = info.scale;
|
||||
_mobDirtySlots[index] = true;
|
||||
_mobHasDirty = true;
|
||||
}
|
||||
|
||||
private static int ResolveGroupIndex(MobCyalumeUpdateInfo info)
|
||||
{
|
||||
if ((uint)info.unk0 < 11u)
|
||||
return info.unk0;
|
||||
|
||||
if (info.data != null && info.data.keys != null && (uint)info.data.keys.unk48 < 11u)
|
||||
return info.data.keys.unk48;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
private void FlushMobShadowIfNeeded()
|
||||
{
|
||||
if (!_mobHasDirty)
|
||||
return;
|
||||
|
||||
if (_mobShadowController == null)
|
||||
{
|
||||
var assetHolder = GetComponent<AssetHolder>();
|
||||
InitializeMobController(assetHolder);
|
||||
if (_mobShadowController == null)
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < _mobDirtySlots.Length; i++)
|
||||
{
|
||||
if (!_mobDirtySlots[i])
|
||||
continue;
|
||||
|
||||
var position = _mobPositions[i];
|
||||
var rotation = _mobRotations[i];
|
||||
var scale = _mobScales[i];
|
||||
_mobShadowController.SetGroupTRS(i, ref position, ref rotation, ref scale);
|
||||
_mobDirtySlots[i] = false;
|
||||
}
|
||||
|
||||
_mobShadowController.FlushGroupMatrix();
|
||||
_mobHasDirty = false;
|
||||
}
|
||||
|
||||
private void DestroyExistingCyalumeChildren()
|
||||
{
|
||||
for (int i = transform.childCount - 1; i >= 0; i--)
|
||||
{
|
||||
var child = transform.GetChild(i);
|
||||
if (child == null)
|
||||
continue;
|
||||
|
||||
string childName = child.name ?? string.Empty;
|
||||
bool isKnownCyalumeChild =
|
||||
childName.Equals("default", StringComparison.OrdinalIgnoreCase) ||
|
||||
childName.Equals("random", StringComparison.OrdinalIgnoreCase) ||
|
||||
(!string.IsNullOrEmpty(_mobPrefabName) && childName.Equals(_mobPrefabName, StringComparison.OrdinalIgnoreCase)) ||
|
||||
childName.IndexOf("cyalume", StringComparison.OrdinalIgnoreCase) >= 0;
|
||||
|
||||
if (isKnownCyalumeChild)
|
||||
Destroy(child.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
private bool TryInstantiateNamedPrefab(AssetHolder assetHolder, string assetName, out GameObject instance, List<Renderer> destination)
|
||||
{
|
||||
instance = null;
|
||||
destination?.Clear();
|
||||
|
||||
if (!TryResolvePrefab(assetHolder, assetName, out var prefab) || !prefab)
|
||||
{
|
||||
if (_verboseLog)
|
||||
Debug.LogWarning($"[CyalumeController3D] Missing cyalume prefab: {assetName}");
|
||||
return false;
|
||||
}
|
||||
|
||||
instance = Instantiate(prefab, transform);
|
||||
instance.name = prefab.name;
|
||||
SetLayerRecursively(instance, gameObject.layer);
|
||||
|
||||
if (destination != null)
|
||||
{
|
||||
var renderers = instance.GetComponentsInChildren<Renderer>(true);
|
||||
ApplyCustomShaderOverrideToRenderers(renderers);
|
||||
destination.AddRange(renderers);
|
||||
}
|
||||
|
||||
if (_verboseLog)
|
||||
{
|
||||
Debug.Log($"[CyalumeController3D] Spawned cyalume prefab '{assetName}' renderers={destination?.Count ?? 0}");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void SetLayerRecursively(GameObject root, int layer)
|
||||
{
|
||||
if (!root)
|
||||
return;
|
||||
|
||||
root.layer = layer;
|
||||
for (int i = 0; i < root.transform.childCount; i++)
|
||||
{
|
||||
var child = root.transform.GetChild(i);
|
||||
if (child)
|
||||
SetLayerRecursively(child.gameObject, layer);
|
||||
}
|
||||
}
|
||||
|
||||
private static bool TryResolvePrefab(AssetHolder assetHolder, string assetName, out GameObject prefab)
|
||||
{
|
||||
prefab = null;
|
||||
if (assetHolder == null || assetHolder._assetTable == null || assetHolder._assetTable.list == null)
|
||||
return false;
|
||||
|
||||
foreach (var pair in assetHolder._assetTable.list)
|
||||
{
|
||||
var candidate = pair.Value as GameObject;
|
||||
if (!candidate)
|
||||
continue;
|
||||
|
||||
if (candidate.name.Equals(assetName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
prefab = candidate;
|
||||
return true;
|
||||
}
|
||||
|
||||
string keyText = pair.Key != null ? pair.Key.ToString() : string.Empty;
|
||||
if (!string.IsNullOrEmpty(keyText) && keyText.Equals(assetName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
prefab = candidate;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,903 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
using Gallop.Live;
|
||||
|
||||
namespace Gallop.Live.Cyalume
|
||||
{
|
||||
[Serializable]
|
||||
public class CyalumePlaybackData
|
||||
{
|
||||
public int DataNo;
|
||||
public int PatternId;
|
||||
public float StartTime;
|
||||
public float PlaySpeed = 1f;
|
||||
public int ChoreographyType;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CyalumePatternDefinition
|
||||
{
|
||||
public int PatternId;
|
||||
public string MoveType;
|
||||
public string ColorPattern;
|
||||
public string[] Colors = Array.Empty<string>();
|
||||
public string[] Widths = Array.Empty<string>();
|
||||
public string Signature;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CyalumePartFrame
|
||||
{
|
||||
public float StartTime;
|
||||
public int[] States = new int[7];
|
||||
public float[] Volumes = new float[7];
|
||||
public float[] Pans = new float[7];
|
||||
public float VolumeRate = 1f;
|
||||
|
||||
public int GetState(int zoneIndex)
|
||||
{
|
||||
if (States == null || zoneIndex < 0 || zoneIndex >= States.Length)
|
||||
return 0;
|
||||
return States[zoneIndex];
|
||||
}
|
||||
|
||||
public bool IsActive(int zoneIndex)
|
||||
{
|
||||
return GetState(zoneIndex) != 0;
|
||||
}
|
||||
}
|
||||
|
||||
[DisallowMultipleComponent]
|
||||
public class CyalumePlaybackProvider : MonoBehaviour
|
||||
{
|
||||
[Header("Loaded playback data used by the controller.")]
|
||||
public List<CyalumePlaybackData> data = new List<CyalumePlaybackData>();
|
||||
|
||||
[Header("Debug: unique choreography pattern definitions built from the CSV.")]
|
||||
public List<CyalumePatternDefinition> patternDefinitions = new List<CyalumePatternDefinition>();
|
||||
|
||||
[Header("Loaded part data.")]
|
||||
public List<CyalumePartFrame> partFrames = new List<CyalumePartFrame>();
|
||||
|
||||
[Header("Auto-load mXXXX_cyalume.csv for the current live.")]
|
||||
public bool autoLoadForCurrentLive = true;
|
||||
public bool preferResourcesCsv = true;
|
||||
public bool tryLoadBundleEntryFromIndex = true;
|
||||
public bool verboseLog = true;
|
||||
public float bpmReference = 140f;
|
||||
public bool keepPreviousPatternOnPause = true;
|
||||
|
||||
[SerializeField] private int _loadedMusicId;
|
||||
[SerializeField] private string _loadedCsvSource;
|
||||
[SerializeField] private string _loadedPartCsvSource;
|
||||
|
||||
public int LoadedMusicId => _loadedMusicId;
|
||||
public string LoadedCsvSource => _loadedCsvSource;
|
||||
public string LoadedPartCsvSource => _loadedPartCsvSource;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (!autoLoadForCurrentLive || _loadedMusicId > 0 || (data != null && data.Count > 0))
|
||||
return;
|
||||
|
||||
if (Director.instance != null && Director.instance.live != null)
|
||||
{
|
||||
int resolvedMusicId = Director.instance.live.MusicId;
|
||||
if (resolvedMusicId > 0)
|
||||
InitializeForMusicId(resolvedMusicId);
|
||||
}
|
||||
}
|
||||
|
||||
public bool InitializeForMusicId(int musicId, bool forceReload = false)
|
||||
{
|
||||
if (musicId <= 0)
|
||||
{
|
||||
if (verboseLog)
|
||||
Debug.LogWarning("[CyalumePlaybackProvider] InitializeForMusicId failed: invalid musicId.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!forceReload && _loadedMusicId == musicId && data.Count > 0)
|
||||
return true;
|
||||
|
||||
data.Clear();
|
||||
patternDefinitions.Clear();
|
||||
partFrames.Clear();
|
||||
|
||||
_loadedMusicId = musicId;
|
||||
_loadedCsvSource = null;
|
||||
_loadedPartCsvSource = null;
|
||||
|
||||
if (!TryLoadCsvText(musicId, out string csvText, out string sourceName) || string.IsNullOrEmpty(csvText))
|
||||
{
|
||||
if (verboseLog)
|
||||
Debug.LogWarning($"[CyalumePlaybackProvider] Failed to resolve cyalume CSV for musicId={musicId}.");
|
||||
return false;
|
||||
}
|
||||
|
||||
_loadedCsvSource = sourceName;
|
||||
BuildPlaybackDataFromCsv(csvText);
|
||||
|
||||
if (TryLoadPartCsvText(musicId, out string partCsvText, out string partSource) && !string.IsNullOrEmpty(partCsvText))
|
||||
{
|
||||
_loadedPartCsvSource = partSource;
|
||||
BuildPartFramesFromCsv(partCsvText);
|
||||
if (verboseLog)
|
||||
Debug.Log($"[CyalumePlaybackProvider] Loaded part CSV: musicId={musicId}, source={partSource}, rows={partFrames.Count}");
|
||||
}
|
||||
|
||||
if (verboseLog)
|
||||
{
|
||||
Debug.Log($"[CyalumePlaybackProvider] Loaded cyalume CSV: musicId={musicId}, source={sourceName}, rows={data.Count}, uniquePatterns={patternDefinitions.Count}");
|
||||
}
|
||||
|
||||
return data.Count > 0;
|
||||
}
|
||||
|
||||
public bool TryGetCurrent(float liveTime, out CyalumePlaybackData current)
|
||||
{
|
||||
current = null;
|
||||
if (data == null || data.Count == 0)
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
{
|
||||
var item = data[i];
|
||||
if (item == null)
|
||||
continue;
|
||||
|
||||
if (item.StartTime <= liveTime)
|
||||
current = item;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
return current != null;
|
||||
}
|
||||
|
||||
public bool TryGetCurrentPartFrame(float liveTime, out CyalumePartFrame current)
|
||||
{
|
||||
current = null;
|
||||
if (partFrames == null || partFrames.Count == 0)
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < partFrames.Count; i++)
|
||||
{
|
||||
var item = partFrames[i];
|
||||
if (item == null)
|
||||
continue;
|
||||
|
||||
if (item.StartTime <= liveTime)
|
||||
current = item;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
return current != null;
|
||||
}
|
||||
|
||||
public bool TryGetCurrentState(float liveTime, out int patternId, out float patternStartTime, out float playSpeed, out int choreographyType)
|
||||
{
|
||||
if (TryGetCurrent(liveTime, out var current) && current != null)
|
||||
{
|
||||
patternId = Mathf.Max(0, current.PatternId);
|
||||
patternStartTime = current.StartTime;
|
||||
playSpeed = current.PlaySpeed > 0f ? current.PlaySpeed : 1f;
|
||||
choreographyType = current.ChoreographyType;
|
||||
return true;
|
||||
}
|
||||
|
||||
patternId = 0;
|
||||
patternStartTime = 0f;
|
||||
playSpeed = 1f;
|
||||
choreographyType = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool TryGetPatternDefinition(int patternId, out CyalumePatternDefinition definition)
|
||||
{
|
||||
definition = null;
|
||||
if (patternDefinitions == null || patternDefinitions.Count == 0)
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < patternDefinitions.Count; i++)
|
||||
{
|
||||
var item = patternDefinitions[i];
|
||||
if (item != null && item.PatternId == patternId)
|
||||
{
|
||||
definition = item;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsRandomPattern(int patternId)
|
||||
{
|
||||
return TryGetPatternDefinition(patternId, out var definition) &&
|
||||
!string.IsNullOrEmpty(definition.ColorPattern) &&
|
||||
definition.ColorPattern.StartsWith("Random", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public static string BuildPrimaryLiveKey(int musicId)
|
||||
{
|
||||
return $"m{musicId}";
|
||||
}
|
||||
|
||||
public static string[] BuildLiveKeyCandidates(int musicId)
|
||||
{
|
||||
var keys = new List<string>();
|
||||
string raw = $"m{musicId}";
|
||||
keys.Add(raw);
|
||||
|
||||
string padded4 = $"m{musicId:D4}";
|
||||
if (!keys.Any(x => string.Equals(x, padded4, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
keys.Add(padded4);
|
||||
}
|
||||
|
||||
return keys.ToArray();
|
||||
}
|
||||
|
||||
private bool TryLoadCsvText(int musicId, out string csvText, out string sourceName)
|
||||
{
|
||||
csvText = null;
|
||||
sourceName = null;
|
||||
|
||||
string[] liveKeys = BuildLiveKeyCandidates(musicId);
|
||||
string[] resourcePaths = BuildResourcePathCandidates(liveKeys);
|
||||
|
||||
if (preferResourcesCsv)
|
||||
{
|
||||
for (int i = 0; i < resourcePaths.Length; i++)
|
||||
{
|
||||
string resourcePath = resourcePaths[i];
|
||||
if (string.IsNullOrEmpty(resourcePath))
|
||||
continue;
|
||||
|
||||
TextAsset asset = null;
|
||||
try
|
||||
{
|
||||
asset = Resources.Load<TextAsset>(resourcePath);
|
||||
}
|
||||
catch
|
||||
{
|
||||
asset = null;
|
||||
}
|
||||
|
||||
if (asset != null && !string.IsNullOrEmpty(asset.text))
|
||||
{
|
||||
csvText = asset.text;
|
||||
sourceName = $"Resources/{resourcePath}";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (TryFindCsvInLoadedBundles(liveKeys, out csvText, out sourceName))
|
||||
return true;
|
||||
|
||||
if (tryLoadBundleEntryFromIndex)
|
||||
{
|
||||
TryLoadCsvBundlesFromIndex(liveKeys);
|
||||
if (TryFindCsvInLoadedBundles(liveKeys, out csvText, out sourceName))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool TryLoadPartCsvText(int musicId, out string csvText, out string sourceName)
|
||||
{
|
||||
csvText = null;
|
||||
sourceName = null;
|
||||
|
||||
string[] liveKeys = BuildLiveKeyCandidates(musicId);
|
||||
|
||||
for (int i = 0; i < liveKeys.Length; i++)
|
||||
{
|
||||
string liveKey = liveKeys[i];
|
||||
string[] candidates =
|
||||
{
|
||||
$"live/musicscores/{liveKey}/{liveKey}_part",
|
||||
$"live/musicscores/{liveKey}/{liveKey}_part.csv",
|
||||
$"{liveKey}_part"
|
||||
};
|
||||
|
||||
for (int j = 0; j < candidates.Length; j++)
|
||||
{
|
||||
TextAsset asset = null;
|
||||
try
|
||||
{
|
||||
asset = Resources.Load<TextAsset>(candidates[j]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
asset = null;
|
||||
}
|
||||
|
||||
if (asset != null && !string.IsNullOrEmpty(asset.text))
|
||||
{
|
||||
csvText = asset.text;
|
||||
sourceName = $"Resources/{candidates[j]}";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (TryFindAuxCsvInLoadedBundles(liveKeys, "part", out csvText, out sourceName))
|
||||
return true;
|
||||
|
||||
if (tryLoadBundleEntryFromIndex)
|
||||
{
|
||||
TryLoadAuxCsvBundlesFromIndex(liveKeys, "part");
|
||||
if (TryFindAuxCsvInLoadedBundles(liveKeys, "part", out csvText, out sourceName))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static string[] BuildResourcePathCandidates(string[] liveKeys)
|
||||
{
|
||||
var candidates = new List<string>();
|
||||
for (int i = 0; i < liveKeys.Length; i++)
|
||||
{
|
||||
string liveKey = liveKeys[i];
|
||||
candidates.Add($"live/musicscores/{liveKey}/{liveKey}_cyalume");
|
||||
candidates.Add($"live/musicscores/{liveKey}/{liveKey}_cyalume.csv");
|
||||
candidates.Add($"{liveKey}_cyalume");
|
||||
}
|
||||
return candidates.Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
|
||||
}
|
||||
|
||||
private void TryLoadCsvBundlesFromIndex(string[] liveKeys)
|
||||
{
|
||||
var main = FindObjectOfType<UmaViewerMain>();
|
||||
if (main == null || main.AbList == null)
|
||||
return;
|
||||
|
||||
var entries = main.AbList.Values
|
||||
.Where(e => e != null && !string.IsNullOrEmpty(e.Name))
|
||||
.Where(e => liveKeys.Any(liveKey =>
|
||||
e.Name.IndexOf($"live/musicscores/{liveKey}/", StringComparison.OrdinalIgnoreCase) >= 0 &&
|
||||
e.Name.IndexOf($"{liveKey}_cyalume", StringComparison.OrdinalIgnoreCase) >= 0))
|
||||
.ToList();
|
||||
|
||||
foreach (var entry in entries)
|
||||
{
|
||||
try
|
||||
{
|
||||
UmaAssetManager.LoadAssetBundle(entry, neverUnload: true, isRecursive: true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (verboseLog)
|
||||
{
|
||||
Debug.LogWarning($"[CyalumePlaybackProvider] Failed to load CSV bundle entry {entry?.Name}: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void TryLoadAuxCsvBundlesFromIndex(string[] liveKeys, string suffix)
|
||||
{
|
||||
var main = FindObjectOfType<UmaViewerMain>();
|
||||
if (main == null || main.AbList == null)
|
||||
return;
|
||||
|
||||
var entries = main.AbList.Values
|
||||
.Where(e => e != null && !string.IsNullOrEmpty(e.Name))
|
||||
.Where(e => liveKeys.Any(liveKey =>
|
||||
e.Name.IndexOf($"live/musicscores/{liveKey}/", StringComparison.OrdinalIgnoreCase) >= 0 &&
|
||||
e.Name.IndexOf($"{liveKey}_{suffix}", StringComparison.OrdinalIgnoreCase) >= 0))
|
||||
.ToList();
|
||||
|
||||
foreach (var entry in entries)
|
||||
{
|
||||
try
|
||||
{
|
||||
UmaAssetManager.LoadAssetBundle(entry, neverUnload: true, isRecursive: true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (verboseLog)
|
||||
{
|
||||
Debug.LogWarning($"[CyalumePlaybackProvider] Failed to load {suffix} CSV bundle entry {entry?.Name}: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool TryFindCsvInLoadedBundles(string[] liveKeys, out string csvText, out string sourceName)
|
||||
{
|
||||
csvText = null;
|
||||
sourceName = null;
|
||||
|
||||
foreach (var assetBundle in AssetBundle.GetAllLoadedAssetBundles())
|
||||
{
|
||||
if (!assetBundle)
|
||||
continue;
|
||||
|
||||
string[] names;
|
||||
try
|
||||
{
|
||||
names = assetBundle.GetAllAssetNames();
|
||||
}
|
||||
catch
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (names == null || names.Length == 0)
|
||||
continue;
|
||||
|
||||
for (int i = 0; i < names.Length; i++)
|
||||
{
|
||||
string path = names[i];
|
||||
if (!IsMatchingCyalumeCsvPath(path, liveKeys))
|
||||
continue;
|
||||
|
||||
TextAsset textAsset = null;
|
||||
try
|
||||
{
|
||||
textAsset = assetBundle.LoadAsset<TextAsset>(path);
|
||||
}
|
||||
catch
|
||||
{
|
||||
textAsset = null;
|
||||
}
|
||||
|
||||
if (textAsset == null || string.IsNullOrEmpty(textAsset.text))
|
||||
continue;
|
||||
|
||||
csvText = textAsset.text;
|
||||
sourceName = path;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool TryFindAuxCsvInLoadedBundles(string[] liveKeys, string suffix, out string csvText, out string sourceName)
|
||||
{
|
||||
csvText = null;
|
||||
sourceName = null;
|
||||
|
||||
foreach (var assetBundle in AssetBundle.GetAllLoadedAssetBundles())
|
||||
{
|
||||
if (!assetBundle)
|
||||
continue;
|
||||
|
||||
string[] names;
|
||||
try
|
||||
{
|
||||
names = assetBundle.GetAllAssetNames();
|
||||
}
|
||||
catch
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (names == null || names.Length == 0)
|
||||
continue;
|
||||
|
||||
for (int i = 0; i < names.Length; i++)
|
||||
{
|
||||
string path = names[i];
|
||||
if (!IsMatchingAuxCsvPath(path, liveKeys, suffix))
|
||||
continue;
|
||||
|
||||
TextAsset textAsset = null;
|
||||
try
|
||||
{
|
||||
textAsset = assetBundle.LoadAsset<TextAsset>(path);
|
||||
}
|
||||
catch
|
||||
{
|
||||
textAsset = null;
|
||||
}
|
||||
|
||||
if (textAsset == null || string.IsNullOrEmpty(textAsset.text))
|
||||
continue;
|
||||
|
||||
csvText = textAsset.text;
|
||||
sourceName = path;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool IsMatchingCyalumeCsvPath(string path, string[] liveKeys)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path) || liveKeys == null || liveKeys.Length == 0)
|
||||
return false;
|
||||
|
||||
string normalized = path.Replace('\\', '/');
|
||||
for (int i = 0; i < liveKeys.Length; i++)
|
||||
{
|
||||
string liveKey = liveKeys[i];
|
||||
if (normalized.IndexOf($"live/musicscores/{liveKey}/", StringComparison.OrdinalIgnoreCase) < 0)
|
||||
continue;
|
||||
|
||||
string fileName = Path.GetFileNameWithoutExtension(normalized);
|
||||
if (string.Equals(fileName, $"{liveKey}_cyalume", StringComparison.OrdinalIgnoreCase))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool IsMatchingAuxCsvPath(string path, string[] liveKeys, string suffix)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path) || liveKeys == null || liveKeys.Length == 0)
|
||||
return false;
|
||||
|
||||
string normalized = path.Replace('\\', '/');
|
||||
for (int i = 0; i < liveKeys.Length; i++)
|
||||
{
|
||||
string liveKey = liveKeys[i];
|
||||
if (normalized.IndexOf($"live/musicscores/{liveKey}/", StringComparison.OrdinalIgnoreCase) < 0)
|
||||
continue;
|
||||
|
||||
string fileName = Path.GetFileNameWithoutExtension(normalized);
|
||||
if (string.Equals(fileName, $"{liveKey}_{suffix}", StringComparison.OrdinalIgnoreCase))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void BuildPlaybackDataFromCsv(string csvText)
|
||||
{
|
||||
data.Clear();
|
||||
patternDefinitions.Clear();
|
||||
|
||||
if (string.IsNullOrEmpty(csvText))
|
||||
return;
|
||||
|
||||
var rows = ParseCsvRows(csvText);
|
||||
if (rows.Count <= 1)
|
||||
return;
|
||||
|
||||
var headerMap = BuildHeaderMap(rows[0]);
|
||||
if (!headerMap.ContainsKey("time"))
|
||||
{
|
||||
if (verboseLog)
|
||||
Debug.LogWarning("[CyalumePlaybackProvider] CSV missing time column.");
|
||||
return;
|
||||
}
|
||||
|
||||
var patternMap = new Dictionary<string, int>(StringComparer.Ordinal);
|
||||
int lastVisualPatternId = 0;
|
||||
bool hasLastVisualPattern = false;
|
||||
|
||||
for (int rowIndex = 1; rowIndex < rows.Count; rowIndex++)
|
||||
{
|
||||
var row = rows[rowIndex];
|
||||
if (row == null || row.Count == 0)
|
||||
continue;
|
||||
|
||||
if (!TryParseTimeSeconds(GetCell(row, headerMap, "time"), out float startTime))
|
||||
continue;
|
||||
|
||||
string moveType = NormalizeCell(GetCell(row, headerMap, "move_type"));
|
||||
string colorPattern = NormalizeCell(GetCell(row, headerMap, "color_pattern"));
|
||||
string[] colors = GetSeriesCells(row, headerMap, "color", 5);
|
||||
string[] widths = GetSeriesCells(row, headerMap, "width", 5);
|
||||
|
||||
int choreographyType = ComputeChoreographyType(moveType);
|
||||
bool isPauseLike = keepPreviousPatternOnPause && choreographyType >= 8;
|
||||
|
||||
int patternId;
|
||||
if (isPauseLike)
|
||||
{
|
||||
patternId = hasLastVisualPattern ? lastVisualPatternId : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
string signature = BuildPatternSignature(moveType, colorPattern, colors, widths);
|
||||
if (!patternMap.TryGetValue(signature, out patternId))
|
||||
{
|
||||
patternId = patternMap.Count;
|
||||
patternMap[signature] = patternId;
|
||||
|
||||
patternDefinitions.Add(new CyalumePatternDefinition
|
||||
{
|
||||
PatternId = patternId,
|
||||
MoveType = moveType,
|
||||
ColorPattern = colorPattern,
|
||||
Colors = colors.ToArray(),
|
||||
Widths = widths.ToArray(),
|
||||
Signature = signature,
|
||||
});
|
||||
}
|
||||
|
||||
lastVisualPatternId = patternId;
|
||||
hasLastVisualPattern = true;
|
||||
}
|
||||
|
||||
float playSpeed = ComputePlaySpeed(GetCell(row, headerMap, "bpm"));
|
||||
|
||||
data.Add(new CyalumePlaybackData
|
||||
{
|
||||
DataNo = data.Count,
|
||||
PatternId = patternId,
|
||||
StartTime = startTime,
|
||||
PlaySpeed = playSpeed,
|
||||
ChoreographyType = choreographyType,
|
||||
});
|
||||
}
|
||||
|
||||
data.Sort((a, b) => a.StartTime.CompareTo(b.StartTime));
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
{
|
||||
data[i].DataNo = i;
|
||||
}
|
||||
}
|
||||
|
||||
private void BuildPartFramesFromCsv(string csvText)
|
||||
{
|
||||
partFrames.Clear();
|
||||
if (string.IsNullOrEmpty(csvText))
|
||||
return;
|
||||
|
||||
var rows = ParseCsvRows(csvText);
|
||||
if (rows.Count <= 1)
|
||||
return;
|
||||
|
||||
var headerMap = BuildHeaderMap(rows[0]);
|
||||
if (!headerMap.ContainsKey("time"))
|
||||
{
|
||||
if (verboseLog)
|
||||
Debug.LogWarning("[CyalumePlaybackProvider] Part CSV missing time column.");
|
||||
return;
|
||||
}
|
||||
|
||||
string[] zoneNames = { "left3", "left2", "left", "center", "right", "right2", "right3" };
|
||||
|
||||
for (int rowIndex = 1; rowIndex < rows.Count; rowIndex++)
|
||||
{
|
||||
var row = rows[rowIndex];
|
||||
if (row == null || row.Count == 0)
|
||||
continue;
|
||||
|
||||
if (!TryParseTimeSeconds(GetCell(row, headerMap, "time"), out float startTime))
|
||||
continue;
|
||||
|
||||
var frame = new CyalumePartFrame();
|
||||
frame.StartTime = startTime;
|
||||
|
||||
for (int i = 0; i < zoneNames.Length; i++)
|
||||
{
|
||||
frame.States[i] = ParseIntOrDefault(GetCell(row, headerMap, zoneNames[i]), 0);
|
||||
frame.Volumes[i] = ParseFloatOrSentinel(GetCell(row, headerMap, zoneNames[i] + "_vol"));
|
||||
frame.Pans[i] = ParseFloatOrSentinel(GetCell(row, headerMap, zoneNames[i] + "_pan"));
|
||||
}
|
||||
|
||||
frame.VolumeRate = ParseFloatOrDefault(GetCell(row, headerMap, "volume_rate"), 1f);
|
||||
partFrames.Add(frame);
|
||||
}
|
||||
|
||||
partFrames.Sort((a, b) => a.StartTime.CompareTo(b.StartTime));
|
||||
}
|
||||
|
||||
private static Dictionary<string, int> BuildHeaderMap(List<string> header)
|
||||
{
|
||||
var map = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
|
||||
if (header == null)
|
||||
return map;
|
||||
|
||||
for (int i = 0; i < header.Count; i++)
|
||||
{
|
||||
string key = NormalizeHeader(header[i]);
|
||||
if (string.IsNullOrEmpty(key) || map.ContainsKey(key))
|
||||
continue;
|
||||
map[key] = i;
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
private static string NormalizeHeader(string value)
|
||||
{
|
||||
return (value ?? string.Empty).Trim().Trim('\ufeff').ToLowerInvariant();
|
||||
}
|
||||
|
||||
private static string GetCell(List<string> row, Dictionary<string, int> headerMap, string key)
|
||||
{
|
||||
if (row == null || headerMap == null || !headerMap.TryGetValue(key, out int index))
|
||||
return null;
|
||||
|
||||
return index >= 0 && index < row.Count ? row[index] : null;
|
||||
}
|
||||
|
||||
private static string[] GetSeriesCells(List<string> row, Dictionary<string, int> headerMap, string prefix, int count)
|
||||
{
|
||||
var values = new string[count];
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
values[i] = NormalizeCell(GetCell(row, headerMap, $"{prefix}{i + 1}"));
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
private static string NormalizeCell(string value)
|
||||
{
|
||||
return (value ?? string.Empty).Trim();
|
||||
}
|
||||
|
||||
private static string BuildPatternSignature(string moveType, string colorPattern, string[] colors, string[] widths)
|
||||
{
|
||||
var parts = new List<string>(2 + (colors?.Length ?? 0) + (widths?.Length ?? 0))
|
||||
{
|
||||
NormalizeSignatureValue(moveType),
|
||||
NormalizeSignatureValue(colorPattern)
|
||||
};
|
||||
|
||||
if (colors != null)
|
||||
{
|
||||
for (int i = 0; i < colors.Length; i++)
|
||||
parts.Add(NormalizeSignatureValue(colors[i]));
|
||||
}
|
||||
|
||||
if (widths != null)
|
||||
{
|
||||
for (int i = 0; i < widths.Length; i++)
|
||||
parts.Add(NormalizeSignatureValue(widths[i]));
|
||||
}
|
||||
|
||||
return string.Join("|", parts);
|
||||
}
|
||||
|
||||
private static string NormalizeSignatureValue(string value)
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(value) ? "-" : value.Trim().ToLowerInvariant();
|
||||
}
|
||||
|
||||
private bool TryParseTimeSeconds(string rawValue, out float seconds)
|
||||
{
|
||||
seconds = 0f;
|
||||
if (string.IsNullOrWhiteSpace(rawValue))
|
||||
return false;
|
||||
|
||||
rawValue = rawValue.Trim();
|
||||
if (int.TryParse(rawValue, out int milliseconds))
|
||||
{
|
||||
seconds = milliseconds / 1000f;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (float.TryParse(rawValue, System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out float value))
|
||||
{
|
||||
seconds = value > 1000f ? (value / 1000f) : value;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private float ComputePlaySpeed(string bpmValue)
|
||||
{
|
||||
float fallback = 1f;
|
||||
if (string.IsNullOrWhiteSpace(bpmValue))
|
||||
return fallback;
|
||||
|
||||
if (!float.TryParse(bpmValue, System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out float bpm))
|
||||
return fallback;
|
||||
|
||||
if (bpm <= 0f)
|
||||
return fallback;
|
||||
|
||||
float reference = bpmReference > 0f ? bpmReference : 140f;
|
||||
return Mathf.Max(0.01f, bpm / reference);
|
||||
}
|
||||
|
||||
private static int ComputeChoreographyType(string moveType)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(moveType))
|
||||
return 0;
|
||||
|
||||
return string.Equals(moveType.Trim(), "Pause", StringComparison.OrdinalIgnoreCase) ? 8 : 0;
|
||||
}
|
||||
|
||||
private static int ParseIntOrDefault(string raw, int fallback)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(raw))
|
||||
return fallback;
|
||||
|
||||
return int.TryParse(raw.Trim(), out int value) ? value : fallback;
|
||||
}
|
||||
|
||||
private static float ParseFloatOrDefault(string raw, float fallback)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(raw))
|
||||
return fallback;
|
||||
|
||||
return float.TryParse(raw.Trim(), System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out float value)
|
||||
? value
|
||||
: fallback;
|
||||
}
|
||||
|
||||
private static float ParseFloatOrSentinel(string raw)
|
||||
{
|
||||
float value = ParseFloatOrDefault(raw, 999f);
|
||||
return Mathf.Approximately(value, 999f) ? float.NaN : value;
|
||||
}
|
||||
|
||||
private static List<List<string>> ParseCsvRows(string text)
|
||||
{
|
||||
var rows = new List<List<string>>();
|
||||
if (string.IsNullOrEmpty(text))
|
||||
return rows;
|
||||
|
||||
var row = new List<string>();
|
||||
var cell = new StringBuilder();
|
||||
bool inQuotes = false;
|
||||
|
||||
for (int i = 0; i < text.Length; i++)
|
||||
{
|
||||
char c = text[i];
|
||||
if (inQuotes)
|
||||
{
|
||||
if (c == '"')
|
||||
{
|
||||
bool escapedQuote = i + 1 < text.Length && text[i + 1] == '"';
|
||||
if (escapedQuote)
|
||||
{
|
||||
cell.Append('"');
|
||||
i++;
|
||||
}
|
||||
else
|
||||
{
|
||||
inQuotes = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cell.Append(c);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '"':
|
||||
inQuotes = true;
|
||||
break;
|
||||
case ',':
|
||||
row.Add(cell.ToString());
|
||||
cell.Length = 0;
|
||||
break;
|
||||
case '\r':
|
||||
break;
|
||||
case '\n':
|
||||
row.Add(cell.ToString());
|
||||
cell.Length = 0;
|
||||
rows.Add(row);
|
||||
row = new List<string>();
|
||||
break;
|
||||
default:
|
||||
cell.Append(c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
row.Add(cell.ToString());
|
||||
if (row.Count > 1 || !string.IsNullOrEmpty(row[0]))
|
||||
rows.Add(row);
|
||||
|
||||
return rows;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2acb0c9d0ca50ba45b7d9a2ae70d860d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,140 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Gallop.Cyalume
|
||||
{
|
||||
[AddComponentMenu("")]
|
||||
public class MobShadowController : MonoBehaviour
|
||||
{
|
||||
private static readonly int MobGroupMatrixPropertyId = Shader.PropertyToID("_MobGroupMatrix");
|
||||
|
||||
[SerializeField] private string _mobColorPropertyName = "_MobColor";
|
||||
[SerializeField] private string _maskPosArrayPropertyName = "_MaskPosArray";
|
||||
[SerializeField] private string _groupMatrixArrayPropertyName = "_MobGroupMatrix";
|
||||
|
||||
private GameObject _targetObject;
|
||||
private Transform _targetObjectTransform;
|
||||
private Vector3 _targetObjectInitPosition;
|
||||
private bool _isInitialized;
|
||||
private Renderer[] _renderers;
|
||||
private Color _mobColor;
|
||||
private Color _ambientColor;
|
||||
private int _mobColorPropertyId;
|
||||
private int _maskPosArrayPropertyId;
|
||||
private int _groupMatrixArrayPropertyId;
|
||||
private Vector4[] _maskPosArray;
|
||||
private Matrix4x4[] _groupMatrixArray;
|
||||
private bool _isUpdateGroupMatrix;
|
||||
|
||||
public Vector4[] MaskPosArray
|
||||
{
|
||||
set
|
||||
{
|
||||
_maskPosArray = value;
|
||||
}
|
||||
}
|
||||
|
||||
public MobShadowController()
|
||||
{
|
||||
_mobColor = Color.white;
|
||||
_ambientColor = Color.white;
|
||||
_mobColorPropertyId = -1;
|
||||
_maskPosArrayPropertyId = -1;
|
||||
_groupMatrixArrayPropertyId = -1;
|
||||
_groupMatrixArray = new Matrix4x4[11];
|
||||
}
|
||||
|
||||
public void Initialize(GameObject targetObject)
|
||||
{
|
||||
_mobColorPropertyId = string.IsNullOrEmpty(_mobColorPropertyName) ? -1 : Shader.PropertyToID(_mobColorPropertyName);
|
||||
_maskPosArrayPropertyId = string.IsNullOrEmpty(_maskPosArrayPropertyName) ? -1 : Shader.PropertyToID(_maskPosArrayPropertyName);
|
||||
_groupMatrixArrayPropertyId = string.IsNullOrEmpty(_groupMatrixArrayPropertyName) ? -1 : Shader.PropertyToID(_groupMatrixArrayPropertyName);
|
||||
|
||||
_targetObject = targetObject;
|
||||
if (_targetObject == null)
|
||||
return;
|
||||
|
||||
_targetObjectTransform = _targetObject.transform;
|
||||
if (_targetObjectTransform == null)
|
||||
return;
|
||||
|
||||
_targetObjectInitPosition = _targetObjectTransform.position;
|
||||
_renderers = _targetObject.GetComponentsInChildren<Renderer>();
|
||||
|
||||
if (_groupMatrixArray == null)
|
||||
_groupMatrixArray = new Matrix4x4[11];
|
||||
|
||||
for (int i = 0; i < _groupMatrixArray.Length; i++)
|
||||
{
|
||||
_groupMatrixArray[i] = Matrix4x4.identity;
|
||||
}
|
||||
|
||||
_isUpdateGroupMatrix = true;
|
||||
_isInitialized = true;
|
||||
}
|
||||
|
||||
public void SetMobColor(Color color)
|
||||
{
|
||||
_mobColor = color;
|
||||
_UpdateShaderParamColor();
|
||||
}
|
||||
|
||||
public void SetAmbientColor(Color color)
|
||||
{
|
||||
_ambientColor = color;
|
||||
_UpdateShaderParamColor();
|
||||
}
|
||||
|
||||
public void SetGroupTRS(int index, ref Vector3 position, ref Quaternion rotation, ref Vector3 scale)
|
||||
{
|
||||
if (!_isInitialized)
|
||||
return;
|
||||
|
||||
if (_groupMatrixArray == null)
|
||||
return;
|
||||
|
||||
if ((uint)index >= (uint)_groupMatrixArray.Length)
|
||||
return;
|
||||
|
||||
_groupMatrixArray[index].SetTRS(position, rotation, scale);
|
||||
_isUpdateGroupMatrix = true;
|
||||
}
|
||||
|
||||
public void FlushGroupMatrix()
|
||||
{
|
||||
if (!_isInitialized || !_isUpdateGroupMatrix || _groupMatrixArray == null)
|
||||
return;
|
||||
|
||||
_isUpdateGroupMatrix = false;
|
||||
|
||||
int propertyId = _groupMatrixArrayPropertyId >= 0
|
||||
? _groupMatrixArrayPropertyId
|
||||
: MobGroupMatrixPropertyId;
|
||||
|
||||
Shader.SetGlobalMatrixArray(propertyId, _groupMatrixArray);
|
||||
}
|
||||
|
||||
private void _UpdateShaderParamColor()
|
||||
{
|
||||
if (_renderers == null)
|
||||
return;
|
||||
|
||||
Color finalColor = new Color(
|
||||
_ambientColor.r * _mobColor.r,
|
||||
_ambientColor.g * _mobColor.g,
|
||||
_ambientColor.b * _mobColor.b,
|
||||
_ambientColor.a * _mobColor.a
|
||||
);
|
||||
|
||||
if (_mobColorPropertyId >= 0)
|
||||
Shader.SetGlobalColor(_mobColorPropertyId, finalColor);
|
||||
|
||||
if (_maskPosArray != null && _maskPosArrayPropertyId >= 0)
|
||||
Shader.SetGlobalVectorArray(_maskPosArrayPropertyId, _maskPosArray);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab50ba8b988b5cd43823243f52c6136b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -6,6 +6,8 @@ using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
using Gallop.Live.Cyalume;
|
||||
using Gallop.RenderPipeline;
|
||||
|
||||
namespace Gallop.Live
|
||||
{
|
||||
@@ -54,6 +56,9 @@ namespace Gallop.Live
|
||||
private Dictionary<string, Vector2> _uvScrollAccum = new Dictionary<string, Vector2>();
|
||||
|
||||
private Volume _postProcessVolume;
|
||||
private readonly Dictionary<int, GameObject> _liveProps = new Dictionary<int, GameObject>();
|
||||
private readonly Dictionary<LiveTimelineAdditionalLight, Light> _additionalLights = new Dictionary<LiveTimelineAdditionalLight, Light>();
|
||||
private readonly Dictionary<LiveTimelineLightProjectionData, Light> _projectionLights = new Dictionary<LiveTimelineLightProjectionData, Light>();
|
||||
|
||||
public UmaViewerAudio.CuteAudioSource liveMusic = new UmaViewerAudio.CuteAudioSource();
|
||||
|
||||
@@ -80,6 +85,12 @@ namespace Gallop.Live
|
||||
public Transform MainCameraTransform => _mainCameraTransform;
|
||||
|
||||
private Transform _mainCameraTransform;
|
||||
private bool _playbackPaused;
|
||||
private bool _freeCameraActive;
|
||||
private FreeCam _freeCamera;
|
||||
|
||||
public bool PlaybackPaused => _playbackPaused;
|
||||
public bool FreeCameraActive => _freeCameraActive;
|
||||
|
||||
public bool isTimelineControlled
|
||||
{
|
||||
@@ -111,6 +122,10 @@ namespace Gallop.Live
|
||||
if (live != null)
|
||||
{
|
||||
_instance = this;
|
||||
if (GetComponent<SkirtCollisionRuntimeTuner>() == null)
|
||||
gameObject.AddComponent<SkirtCollisionRuntimeTuner>();
|
||||
if (GetComponent<LivePlaybackToolbar>() == null)
|
||||
gameObject.AddComponent<LivePlaybackToolbar>();
|
||||
Debug.Log(string.Format(CUTT_PATH, live.MusicId));
|
||||
Builder.LoadAssetPath(string.Format(CUTT_PATH, live.MusicId), transform);
|
||||
if (RequireStage)
|
||||
@@ -119,6 +134,8 @@ namespace Gallop.Live
|
||||
Builder.LoadAssetPath(string.Format(STAGE_PATH, live.BackGroundId), transform);
|
||||
_liveTimelineControl.StageObjectMap = _stageController.StageObjectMap;
|
||||
_liveTimelineControl.StageObjectUnitMap = _stageController.StageObjectUnitMap;
|
||||
InitializeCyalumeStage();
|
||||
InitializeStageMonitor();
|
||||
}
|
||||
|
||||
//Make CharacterObject
|
||||
@@ -231,6 +248,14 @@ namespace Gallop.Live
|
||||
_liveTimelineControl.OnUpdateChromaticAberration += OnChromaticAberrationUpdate;
|
||||
_liveTimelineControl.OnUpdateColorCorrection += OnColorCorrectionUpdate;
|
||||
_liveTimelineControl.OnUpdatePostFilm += OnPostFilmUpdate;
|
||||
_liveTimelineControl.OnUpdateLensFlare += OnLensFlareUpdate;
|
||||
_liveTimelineControl.OnUpdateEnvironment += OnEnvironmentUpdate;
|
||||
_liveTimelineControl.OnUpdateFacialToon += OnFacialToonUpdate;
|
||||
_liveTimelineControl.OnUpdateProps += OnPropsUpdate;
|
||||
_liveTimelineControl.OnUpdatePropsAttach += OnPropsAttachUpdate;
|
||||
_liveTimelineControl.OnUpdateCharaFootLight += OnCharaFootLightUpdate;
|
||||
_liveTimelineControl.OnUpdateAdditionalLight += OnAdditionalLightUpdate;
|
||||
_liveTimelineControl.OnUpdateLightProjection += OnLightProjectionUpdate;
|
||||
PostFilmRendererFeature.ResetLayers();
|
||||
|
||||
// 获取或创建摄像机上的 Volume 组件,供后处理 handler 使用
|
||||
@@ -252,6 +277,39 @@ namespace Gallop.Live
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeCyalumeStage()
|
||||
{
|
||||
if (_stageController == null) return;
|
||||
|
||||
foreach (var holder in _stageController.GetComponentsInChildren<AssetHolder>(true))
|
||||
{
|
||||
if (holder == null || holder._assetTable == null || holder._assetTable.list == null) continue;
|
||||
|
||||
bool hasDefault = false;
|
||||
bool hasRandom = false;
|
||||
foreach (var entry in holder._assetTable.list)
|
||||
{
|
||||
if (string.Equals(entry.Key, "default", StringComparison.OrdinalIgnoreCase)) hasDefault = true;
|
||||
if (string.Equals(entry.Key, "random", StringComparison.OrdinalIgnoreCase)) hasRandom = true;
|
||||
}
|
||||
|
||||
if (!hasDefault && !hasRandom) continue;
|
||||
var controller = holder.GetComponent<CyalumeController3D>();
|
||||
if (controller == null) controller = holder.gameObject.AddComponent<CyalumeController3D>();
|
||||
controller.StartOfficialLikeSetup();
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log("[Cyalume] no audience AssetHolder was present on this stage.");
|
||||
}
|
||||
|
||||
private void InitializeStageMonitor()
|
||||
{
|
||||
if (_stageController == null) return;
|
||||
if (_stageController.GetComponent<StageMonitorDriver>() == null)
|
||||
_stageController.gameObject.AddComponent<StageMonitorDriver>();
|
||||
}
|
||||
|
||||
private void OnEffectUpdate(LiveTimelineEffectData effectData, LiveTimelineKeyEffectData keyData)
|
||||
{
|
||||
if (keyData == null) return;
|
||||
@@ -280,6 +338,195 @@ namespace Gallop.Live
|
||||
_activeEffects[effectData] = (keyData.frame, instance);
|
||||
}
|
||||
|
||||
private void OnLensFlareUpdate(LiveTimelineLensFlareData data, LiveTimelineKeyLensFlareData key)
|
||||
{
|
||||
if (key == null || _stageController == null) return;
|
||||
bool enabled = key.enableParameter == 0 || key.enableFlare != 0;
|
||||
foreach (var flare in _stageController.GetComponentsInChildren<CustomLensFlare>(true))
|
||||
{
|
||||
if (flare == null) continue;
|
||||
flare.ApplyTimeline(enabled,
|
||||
key.IsOverridePosition != 0 ? key.offset : flare.transform.localPosition,
|
||||
key.color, key.brightness, key.fadeSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEnvironmentUpdate(LiveTimelineStageEnvironmentData data, LiveTimelineKeyStageEnvironmentData key)
|
||||
{
|
||||
if (key == null || _stageController == null) return;
|
||||
foreach (var mirror in _stageController.GetComponentsInChildren<MirrorReflection>(true))
|
||||
mirror.ApplyTimeline(key.MirrorIsValid, key.MirrorEnabled, key.ReflectionRate);
|
||||
}
|
||||
|
||||
private void OnFacialToonUpdate(int characterIndex, LiveTimelineKeyFacialToonData key)
|
||||
{
|
||||
if (key == null || characterIndex < 0 || characterIndex >= CharaContainerScript.Count) return;
|
||||
var container = CharaContainerScript[characterIndex];
|
||||
if (container == null) return;
|
||||
var block = PropBlock;
|
||||
foreach (var renderer in container.GetComponentsInChildren<Renderer>(true))
|
||||
{
|
||||
if (renderer == null) continue;
|
||||
renderer.GetPropertyBlock(block);
|
||||
foreach (var material in renderer.sharedMaterials)
|
||||
{
|
||||
if (material == null) continue;
|
||||
if (material.HasProperty("_CheekPretenseThreshold")) block.SetFloat("_CheekPretenseThreshold", key.CheekPretenseThreshold);
|
||||
if (material.HasProperty("_NosePretenseThreshold")) block.SetFloat("_NosePretenseThreshold", key.NosePretenseThreshold);
|
||||
if (material.HasProperty("_CylinderBlend")) block.SetFloat("_CylinderBlend", key.CylinderBlend);
|
||||
if (material.HasProperty("_HairNormalBlend")) block.SetFloat("_HairNormalBlend", key.HairNormalBlend);
|
||||
if (material.HasProperty("_UseOriginalDirectionalLight")) block.SetFloat("_UseOriginalDirectionalLight", key.UseOriginalDirectionalLight);
|
||||
if (material.HasProperty("_OriginalDirectionalLightDir")) block.SetVector("_OriginalDirectionalLightDir", key.OriginalDirectionalLightDir);
|
||||
if (material.HasProperty("_EyeToonStep")) block.SetFloat("_EyeToonStep", key.EyeToonStep);
|
||||
if (material.HasProperty("_EyeToonFeather")) block.SetFloat("_EyeToonFeather", key.EyeToonFeather);
|
||||
if (material.HasProperty("_EyeSaturation")) block.SetFloat("_EyeSaturation", key.EyeSaturation);
|
||||
}
|
||||
renderer.SetPropertyBlock(block);
|
||||
}
|
||||
}
|
||||
|
||||
private GameObject ResolveLiveProp(int propsId)
|
||||
{
|
||||
if (_liveProps.TryGetValue(propsId, out var existing) && existing != null) return existing;
|
||||
var settings = _liveTimelineControl?.data?.propsSettings;
|
||||
if (settings?.propsDataGroup == null || propsId < 0 || propsId >= settings.propsDataGroup.Length) return null;
|
||||
var group = settings.propsDataGroup[propsId];
|
||||
if (group == null || string.IsNullOrEmpty(group.propsName) || !UmaViewerMain.Instance.AbList.TryGetValue(group.propsName, out var entry)) return null;
|
||||
var prefab = entry.Get<GameObject>();
|
||||
if (prefab == null) return null;
|
||||
var instance = Instantiate(prefab, transform);
|
||||
instance.name = prefab.name;
|
||||
_liveProps[propsId] = instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
private void OnPropsUpdate(LiveTimelinePropsData data, LiveTimelineKeyPropsData key)
|
||||
{
|
||||
if (key == null) return;
|
||||
var prop = ResolveLiveProp(key.propsID);
|
||||
if (prop == null) return;
|
||||
foreach (var renderer in prop.GetComponentsInChildren<Renderer>(true))
|
||||
{
|
||||
renderer.enabled = key.rendererEnable != 0;
|
||||
var block = PropBlock;
|
||||
renderer.GetPropertyBlock(block);
|
||||
foreach (var material in renderer.sharedMaterials)
|
||||
{
|
||||
if (material == null) continue;
|
||||
if (material.HasProperty("_Color")) block.SetColor("_Color", key.color);
|
||||
if (material.HasProperty("_RootColor")) block.SetColor("_RootColor", key.rootColor);
|
||||
if (material.HasProperty("_TipColor")) block.SetColor("_TipColor", key.tipColor);
|
||||
if (material.HasProperty("_ColorPower")) block.SetFloat("_ColorPower", key.colorPower);
|
||||
if (key.IsUpdateOutline != 0 && material.HasProperty("_OutlineWidth")) block.SetFloat("_OutlineWidth", key.OutlineWidth);
|
||||
if (key.IsUpdateOutline != 0 && material.HasProperty("_OutlineColor")) block.SetColor("_OutlineColor", key.OutlineColor);
|
||||
if (key.IsEmissive != 0 && material.HasProperty("_EmissiveColor")) block.SetColor("_EmissiveColor", key.EmissiveColor);
|
||||
}
|
||||
renderer.SetPropertyBlock(block);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPropsAttachUpdate(LiveTimelinePropsAttachData data, LiveTimelineKeyPropsAttachData key)
|
||||
{
|
||||
if (key == null) return;
|
||||
var prop = ResolveLiveProp(key._propsId);
|
||||
if (prop == null) return;
|
||||
Transform target = null;
|
||||
for (int i = 0; i < _liveTimelineControl.liveCharactorLocators.Length && target == null; i++)
|
||||
{
|
||||
if (_liveTimelineControl.liveCharactorLocators[i] is LiveTimelineCharaLocator locator &&
|
||||
locator.Bones != null && locator.Bones.TryGetValue(key._attachJointName, out var bone)) target = bone;
|
||||
}
|
||||
if (target == null) return;
|
||||
prop.transform.SetParent(target, false);
|
||||
prop.transform.localPosition = key._offsetPosition;
|
||||
prop.transform.localRotation = Quaternion.Euler(key.OffsetRotate);
|
||||
prop.transform.localScale = key.OffsetScale;
|
||||
}
|
||||
|
||||
private void OnCharaFootLightUpdate(LiveTimelineKeyCharaFootLightData key)
|
||||
{
|
||||
if (key == null) return;
|
||||
for (int i = 0; i < CharaContainerScript.Count; i++)
|
||||
{
|
||||
if (key.positionFlag != 0 && (key.positionFlag & (1 << i)) == 0) continue;
|
||||
if (i >= key.lightColor.Length || i >= key.hightMax.Length) continue;
|
||||
var container = CharaContainerScript[i];
|
||||
if (container == null) continue;
|
||||
float blend = i < key.LightBlendModeArray.Length ? key.LightBlendModeArray[i] : 0f;
|
||||
float easing = i < key.EasingArray.Length ? key.EasingArray[i] : 0f;
|
||||
var block = PropBlock;
|
||||
foreach (var renderer in container.GetComponentsInChildren<Renderer>(true))
|
||||
{
|
||||
if (renderer == null) continue;
|
||||
bool supported = false;
|
||||
foreach (var material in renderer.sharedMaterials)
|
||||
supported |= material != null && material.HasProperty("_HightLightColor") && material.HasProperty("_HightLightParam");
|
||||
if (!supported) continue;
|
||||
renderer.GetPropertyBlock(block);
|
||||
block.SetColor("_HightLightColor", key.lightColor[i]);
|
||||
block.SetVector("_HightLightParam", new Vector4(key.hightMax[i], blend, easing, 0f));
|
||||
renderer.SetPropertyBlock(block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnAdditionalLightUpdate(LiveTimelineAdditionalLight data, LiveTimelineKeyData_AdditionalLight key)
|
||||
{
|
||||
if (data == null || key == null) return;
|
||||
if (!_additionalLights.TryGetValue(data, out var light) || light == null)
|
||||
{
|
||||
var go = new GameObject(string.IsNullOrEmpty(data.name) ? "AdditionalLight" : data.name);
|
||||
go.transform.SetParent(_stageController != null ? _stageController.transform : transform, false);
|
||||
light = go.AddComponent<Light>();
|
||||
_additionalLights[data] = light;
|
||||
}
|
||||
light.gameObject.SetActive(key.IsEnable != 0);
|
||||
light.transform.localPosition = key.Position;
|
||||
light.transform.localRotation = Quaternion.Euler(key.Rotate);
|
||||
light.type = (LightType)Mathf.Clamp(key.Type, 0, 2);
|
||||
light.range = Mathf.Max(0f, key.Range);
|
||||
light.spotAngle = Mathf.Clamp(key.SpotAngle, 1f, 179f);
|
||||
light.intensity = Mathf.Max(0f, key.Strength);
|
||||
light.bounceIntensity = Mathf.Max(0f, key.IndirectMultiplier);
|
||||
light.shadows = (LightShadows)Mathf.Clamp(key.ShadowType, 0, 2);
|
||||
light.shadowStrength = Mathf.Clamp01(key.Strength);
|
||||
light.shadowBias = Mathf.Max(0f, key.Bias);
|
||||
light.shadowNormalBias = Mathf.Max(0f, key.NormalBias);
|
||||
light.shadowNearPlane = Mathf.Max(0.01f, key.NearPlane);
|
||||
}
|
||||
|
||||
private void OnLightProjectionUpdate(LiveTimelineLightProjectionData data, LiveTimelineKeyLightProjectionData key)
|
||||
{
|
||||
if (data == null || key == null || _stageController == null) return;
|
||||
if (!_projectionLights.TryGetValue(data, out var light) || light == null)
|
||||
{
|
||||
CustomProjector authored = null;
|
||||
foreach (var candidate in _stageController.GetComponentsInChildren<CustomProjector>(true))
|
||||
{
|
||||
if (candidate != null && string.Equals(candidate.name, data.name, StringComparison.OrdinalIgnoreCase))
|
||||
{ authored = candidate; break; }
|
||||
}
|
||||
var host = authored != null ? authored.gameObject : new GameObject(data.name ?? "LightProjection");
|
||||
if (authored == null) host.transform.SetParent(_stageController.transform, false);
|
||||
light = host.GetComponent<Light>();
|
||||
if (light == null) light = host.AddComponent<Light>();
|
||||
light.type = LightType.Spot;
|
||||
if (authored != null) light.cookie = authored.ProjectionTexture;
|
||||
_projectionLights[data] = light;
|
||||
}
|
||||
|
||||
light.gameObject.SetActive(key.IsEnable != 0);
|
||||
light.transform.localPosition = key.Position;
|
||||
light.transform.localRotation = Quaternion.Euler(key.Angle);
|
||||
light.transform.localScale = key.Scale;
|
||||
light.range = Mathf.Max(0.01f, key.FarClipPlane);
|
||||
light.spotAngle = Mathf.Clamp(key.FieldOfView, 1f, 179f);
|
||||
light.color = key.Color;
|
||||
light.intensity = Mathf.Max(0f, key.ColorPower * key.BlinkLightBrightnessPower);
|
||||
light.shadowNearPlane = Mathf.Max(0.01f, key.NearClipPlane);
|
||||
if (key.OverrideIgnoreLayer != 0) light.cullingMask = key.OverrideLayerMask.value;
|
||||
}
|
||||
|
||||
private static GameObject LoadEffectPrefab(string effectName)
|
||||
{
|
||||
string path = string.Format(EFFECT_PATH, effectName);
|
||||
@@ -1311,9 +1558,15 @@ namespace Gallop.Live
|
||||
|
||||
private void UpdateMainCamera()
|
||||
{
|
||||
if (_cameraObjects == null) return;
|
||||
if (_cameraObjects == null || _cameraNodes == null || _cameraTransforms == null) return;
|
||||
if (_freeCameraActive && _freeCamera != null)
|
||||
{
|
||||
_mainCameraTransform = _freeCamera.transform;
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < _cameraNodes.Length; i++)
|
||||
{
|
||||
if (_cameraNodes[i] == null) continue;
|
||||
bool activeSelf = _cameraNodes[i].activeSelf;
|
||||
bool flag = i == _activeCameraIndex;
|
||||
_cameraNodes[i].SetActive(flag);
|
||||
@@ -1322,7 +1575,77 @@ namespace Gallop.Live
|
||||
_cameraLookAt.ActivationUpdate();
|
||||
}
|
||||
}
|
||||
_mainCameraTransform = _cameraTransforms[_activeCameraIndex];
|
||||
if (_activeCameraIndex >= 0 && _activeCameraIndex < _cameraTransforms.Length)
|
||||
_mainCameraTransform = _cameraTransforms[_activeCameraIndex];
|
||||
}
|
||||
|
||||
public void SetPlaybackPaused(bool paused)
|
||||
{
|
||||
if (_playbackPaused == paused || IsRecordVMD)
|
||||
return;
|
||||
|
||||
_playbackPaused = paused;
|
||||
SetAudioPaused(liveMusic, paused);
|
||||
foreach (var vocal in liveVocal)
|
||||
SetAudioPaused(vocal, paused);
|
||||
}
|
||||
|
||||
public void SeekPlayback(float time)
|
||||
{
|
||||
_liveCurrentTime = Mathf.Clamp(time, 0f, Mathf.Max(0f, totalTime - 0.001f));
|
||||
UI.ProgressBar.SetValueWithoutNotify(totalTime > 0f ? _liveCurrentTime / totalTime : 0f);
|
||||
if (liveMusic != null && liveMusic.sourceList != null)
|
||||
UmaViewerAudio.SetTime(liveMusic, _liveCurrentTime);
|
||||
foreach (var vocal in liveVocal)
|
||||
if (vocal != null && vocal.sourceList != null)
|
||||
UmaViewerAudio.SetTime(vocal, _liveCurrentTime);
|
||||
OnTimelineUpdate(_liveCurrentTime);
|
||||
if (_liveTimelineControl != null)
|
||||
_liveTimelineControl.AlterLateUpdate();
|
||||
_syncTime = !_playbackPaused;
|
||||
}
|
||||
|
||||
public void SetFreeCameraEnabled(bool enabled)
|
||||
{
|
||||
if (_freeCameraActive == enabled)
|
||||
return;
|
||||
|
||||
if (_freeCamera == null)
|
||||
_freeCamera = Resources.FindObjectsOfTypeAll<FreeCam>().FirstOrDefault(cam => cam.gameObject.scene.IsValid());
|
||||
if (_freeCamera == null)
|
||||
return;
|
||||
|
||||
_freeCameraActive = enabled;
|
||||
if (enabled)
|
||||
{
|
||||
Transform source = _cameraTransforms != null && _activeCameraIndex >= 0 && _activeCameraIndex < _cameraTransforms.Length
|
||||
? _cameraTransforms[_activeCameraIndex] : null;
|
||||
if (source != null)
|
||||
_freeCamera.transform.SetPositionAndRotation(source.position, source.rotation);
|
||||
_freeCamera.gameObject.SetActive(true);
|
||||
if (_cameraNodes != null)
|
||||
{
|
||||
for (int i = 0; i < _cameraNodes.Length; i++)
|
||||
if (_cameraNodes[i] != null) _cameraNodes[i].SetActive(false);
|
||||
}
|
||||
_mainCameraTransform = _freeCamera.transform;
|
||||
}
|
||||
else
|
||||
{
|
||||
_freeCamera.gameObject.SetActive(false);
|
||||
UpdateMainCamera();
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetAudioPaused(UmaViewerAudio.CuteAudioSource source, bool paused)
|
||||
{
|
||||
if (source == null || source.sourceList == null)
|
||||
return;
|
||||
foreach (var audioSource in source.sourceList)
|
||||
{
|
||||
if (paused) audioSource.Pause();
|
||||
else audioSource.UnPause();
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupCharacterLocator()
|
||||
@@ -1371,6 +1694,13 @@ namespace Gallop.Live
|
||||
public void Play()
|
||||
{
|
||||
|
||||
// Play can be invoked after scene/UI setup has been rebuilt; ensure the
|
||||
// debugging overlay exists and is enabled for the whole playback.
|
||||
LivePlaybackToolbar toolbar = GetComponent<LivePlaybackToolbar>();
|
||||
if (toolbar == null)
|
||||
toolbar = gameObject.AddComponent<LivePlaybackToolbar>();
|
||||
toolbar.enabled = true;
|
||||
|
||||
foreach (var vocal in liveVocal)
|
||||
{
|
||||
UmaViewerAudio.Play(vocal);
|
||||
@@ -1448,6 +1778,10 @@ namespace Gallop.Live
|
||||
OnTimelineUpdate(_liveCurrentTime);
|
||||
_liveTimelineControl.AlterLateUpdate();
|
||||
}
|
||||
else if (_playbackPaused)
|
||||
{
|
||||
// The toolbar can still seek while paused; the timeline itself remains frozen.
|
||||
}
|
||||
else if (sliderControl.is_Outed)
|
||||
{
|
||||
_liveCurrentTime = UI.ProgressBar.value * totalTime;
|
||||
@@ -1612,4 +1946,4 @@ namespace Gallop.Live
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Gallop.Live
|
||||
{
|
||||
/// <summary>Always-visible live debugging controls independent of the scene's auto-hidden UI.</summary>
|
||||
public sealed class LivePlaybackToolbar : MonoBehaviour
|
||||
{
|
||||
private bool _draggingTimeline;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Director.instance == null || !Director.instance._isLiveSetup)
|
||||
return;
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.Space))
|
||||
Director.instance.SetPlaybackPaused(!Director.instance.PlaybackPaused);
|
||||
if (Input.GetKeyDown(KeyCode.F6))
|
||||
Director.instance.SetFreeCameraEnabled(!Director.instance.FreeCameraActive);
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
Director director = Director.instance;
|
||||
if (director == null || !director._isLiveSetup)
|
||||
return;
|
||||
|
||||
// Keep this overlay above the scene's Canvas/UI, which may cover the lower edge.
|
||||
int oldDepth = GUI.depth;
|
||||
GUI.depth = 1000;
|
||||
GUILayout.BeginArea(new Rect(16, Mathf.Max(8, Screen.height - 68), 560, 52), GUI.skin.window);
|
||||
GUILayout.BeginHorizontal();
|
||||
|
||||
if (GUILayout.Button(director.PlaybackPaused ? "Play" : "Pause", GUILayout.Width(62)))
|
||||
director.SetPlaybackPaused(!director.PlaybackPaused);
|
||||
|
||||
bool freeCamera = GUILayout.Toggle(director.FreeCameraActive, "Free Camera", GUILayout.Width(105));
|
||||
if (freeCamera != director.FreeCameraActive)
|
||||
director.SetFreeCameraEnabled(freeCamera);
|
||||
|
||||
float time = GUILayout.HorizontalSlider(director._liveCurrentTime, 0f, Mathf.Max(0.01f, director.totalTime), GUILayout.Width(245));
|
||||
Rect sliderRect = GUILayoutUtility.GetLastRect();
|
||||
Event currentEvent = Event.current;
|
||||
if (currentEvent.type == EventType.MouseDown && sliderRect.Contains(currentEvent.mousePosition))
|
||||
_draggingTimeline = true;
|
||||
if (_draggingTimeline && (currentEvent.type == EventType.MouseDrag || currentEvent.type == EventType.MouseDown))
|
||||
director.SeekPlayback(time);
|
||||
if (currentEvent.type == EventType.MouseUp)
|
||||
_draggingTimeline = false;
|
||||
|
||||
GUILayout.Label(director._liveCurrentTime.ToString("0.00") + " / " + director.totalTime.ToString("0.00"), GUILayout.Width(84));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.EndArea();
|
||||
GUI.depth = oldDepth;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5307220bda8922d4ea2911ec6f0dd3e1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b86c3dce210ee2e4bbd36c6c48abfccb
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b3a700e79167fe49bb840bdda6f8d34
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,2 @@
|
||||
// Kept intentionally empty so stale Unity-generated project files that referenced the
|
||||
// superseded temporary driver remain buildable until Unity regenerates the project.
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3049c310353c9934a8b7c3f938f32bfc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 56c2bfe19657a4c4bb1708407b98fa28
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,357 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Gallop.Live
|
||||
{
|
||||
/// <summary>Runtime tuning for hair, cloth, tail, and accessory spring motion.</summary>
|
||||
public sealed class SkirtCollisionRuntimeTuner : MonoBehaviour
|
||||
{
|
||||
private enum MotionCategory
|
||||
{
|
||||
Skirt,
|
||||
Other
|
||||
}
|
||||
|
||||
private sealed class ParticleDefaults
|
||||
{
|
||||
public DynamicBone.Particle Particle;
|
||||
public MotionCategory Category;
|
||||
public float Damping;
|
||||
public float Elasticity;
|
||||
public float Stiffness;
|
||||
public float Inert;
|
||||
}
|
||||
|
||||
private sealed class ColliderDefaults
|
||||
{
|
||||
public DynamicBoneCollider Collider;
|
||||
public float Radius;
|
||||
}
|
||||
|
||||
private readonly List<ParticleDefaults> _particles = new List<ParticleDefaults>();
|
||||
private readonly HashSet<DynamicBone.Particle> _knownParticles = new HashSet<DynamicBone.Particle>();
|
||||
private readonly List<ColliderDefaults> _hipColliders = new List<ColliderDefaults>();
|
||||
private readonly HashSet<DynamicBoneCollider> _knownHipColliders = new HashSet<DynamicBoneCollider>();
|
||||
private readonly List<ColliderDefaults> _legColliders = new List<ColliderDefaults>();
|
||||
private readonly HashSet<DynamicBoneCollider> _knownLegColliders = new HashSet<DynamicBoneCollider>();
|
||||
private bool _visible;
|
||||
private bool _initialized;
|
||||
private float _dampingScale = 3f;
|
||||
private float _elasticityScale = 1.5f;
|
||||
private float _stiffnessScale = 2f;
|
||||
private float _inertScale = 1.1f;
|
||||
private float _hipRadiusScale = 0.2f;
|
||||
private float _legRadiusScale = 0.8f;
|
||||
private float _horizontalStiffness = 0.5f;
|
||||
private float _otherDampingScale = 3f;
|
||||
private float _otherElasticityScale = 1.5f;
|
||||
private float _otherStiffnessScale = 2f;
|
||||
private float _otherInertScale = 1.1f;
|
||||
private float _otherRigidity = 0.85f;
|
||||
private float _monitorBrightness = 1f;
|
||||
private bool _showSkirtColliders;
|
||||
private bool _skirtBodyCollisionEnabled = true;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.F8))
|
||||
_visible = !_visible;
|
||||
|
||||
if (Director.instance == null || Director.instance.CharaContainerScript.Count == 0)
|
||||
return;
|
||||
|
||||
bool added = false;
|
||||
bool addedCollider = false;
|
||||
foreach (UmaContainerCharacter character in Director.instance.CharaContainerScript)
|
||||
{
|
||||
if (character == null)
|
||||
continue;
|
||||
|
||||
foreach (DynamicBone dynamicBone in character.GetComponentsInChildren<DynamicBone>(true))
|
||||
{
|
||||
MotionCategory category = GetMotionCategory(dynamicBone);
|
||||
foreach (DynamicBone.Particle particle in dynamicBone.Particles)
|
||||
{
|
||||
if (!_knownParticles.Add(particle))
|
||||
continue;
|
||||
|
||||
_particles.Add(new ParticleDefaults
|
||||
{
|
||||
Particle = particle,
|
||||
Category = category,
|
||||
Damping = particle.m_Damping,
|
||||
Elasticity = particle.m_Elasticity,
|
||||
Stiffness = particle.m_Stiffness,
|
||||
Inert = particle.m_Inert
|
||||
});
|
||||
added = true;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (DynamicBoneCollider collider in character.GetComponentsInChildren<DynamicBoneCollider>(true))
|
||||
{
|
||||
if (IsHipSkirtCollider(collider) && _knownHipColliders.Add(collider))
|
||||
{
|
||||
_hipColliders.Add(new ColliderDefaults
|
||||
{
|
||||
Collider = collider,
|
||||
Radius = collider.m_Radius
|
||||
});
|
||||
addedCollider = true;
|
||||
}
|
||||
if (IsLegSkirtCollider(collider) && _knownLegColliders.Add(collider))
|
||||
{
|
||||
_legColliders.Add(new ColliderDefaults
|
||||
{
|
||||
Collider = collider,
|
||||
Radius = collider.m_Radius
|
||||
});
|
||||
addedCollider = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_initialized = _particles.Count > 0;
|
||||
if (added || addedCollider)
|
||||
Apply();
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
if (!_visible || !_initialized)
|
||||
return;
|
||||
|
||||
GUILayout.BeginArea(new Rect(16, 16, 430, 720), GUI.skin.window);
|
||||
GUILayout.Label("Secondary Motion Tuning");
|
||||
|
||||
bool changed = false;
|
||||
changed |= SliderRow("Damping", ref _dampingScale, 0.25f, 4f);
|
||||
changed |= SliderRow("Elasticity", ref _elasticityScale, 0f, 1.5f);
|
||||
changed |= SliderRow("Stiffness", ref _stiffnessScale, 0.25f, 2f);
|
||||
changed |= SliderRow("Inertia", ref _inertScale, 0f, 1.5f);
|
||||
changed |= SliderRow("Hip radius", ref _hipRadiusScale, 0.1f, 1.5f);
|
||||
changed |= SliderRow("Leg radius", ref _legRadiusScale, 0.5f, 1.5f);
|
||||
changed |= SliderRow("Horizontal stiffness", ref _horizontalStiffness, 0f, 1f);
|
||||
|
||||
GUILayout.Space(5);
|
||||
GUILayout.Label("All non-skirt physics (relative to skirt base)");
|
||||
changed |= SliderRow("Other damping", ref _otherDampingScale, 0.25f, 4f);
|
||||
changed |= SliderRow("Other elasticity", ref _otherElasticityScale, 0f, 1.5f);
|
||||
changed |= SliderRow("Other stiffness", ref _otherStiffnessScale, 0.25f, 2f);
|
||||
changed |= SliderRow("Other inertia", ref _otherInertScale, 0f, 1.5f);
|
||||
changed |= SliderRow("Other rigidity", ref _otherRigidity, 0f, 1f);
|
||||
|
||||
GUILayout.Space(5);
|
||||
GUILayout.Label("Live display");
|
||||
changed |= SliderRow("Screen brightness", ref _monitorBrightness, 0f, 1.5f);
|
||||
|
||||
if (GUILayout.Button("Restore defaults", GUILayout.Width(165)))
|
||||
{
|
||||
_dampingScale = 3f;
|
||||
_elasticityScale = 1.5f;
|
||||
_stiffnessScale = 2f;
|
||||
_inertScale = 1.1f;
|
||||
_hipRadiusScale = 0.2f;
|
||||
_legRadiusScale = 0.8f;
|
||||
_horizontalStiffness = 0.5f;
|
||||
_otherDampingScale = 3f;
|
||||
_otherElasticityScale = 1.5f;
|
||||
_otherStiffnessScale = 2f;
|
||||
_otherInertScale = 1.1f;
|
||||
_otherRigidity = 0.85f;
|
||||
_monitorBrightness = 1f;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (changed)
|
||||
Apply();
|
||||
|
||||
bool showColliders = GUILayout.Toggle(_showSkirtColliders, "Show skirt colliders");
|
||||
if (showColliders != _showSkirtColliders)
|
||||
{
|
||||
_showSkirtColliders = showColliders;
|
||||
foreach (SkirtCollisionVisualizer visualizer in Object.FindObjectsOfType<SkirtCollisionVisualizer>(true))
|
||||
visualizer.SetVisible(_showSkirtColliders);
|
||||
}
|
||||
|
||||
bool bodyCollisionEnabled = GUILayout.Toggle(_skirtBodyCollisionEnabled, "Enable skirt body collision");
|
||||
if (bodyCollisionEnabled != _skirtBodyCollisionEnabled)
|
||||
{
|
||||
_skirtBodyCollisionEnabled = bodyCollisionEnabled;
|
||||
SetSkirtBodyCollisionEnabled(_skirtBodyCollisionEnabled);
|
||||
}
|
||||
|
||||
UmaContainerCharacter firstCharacter = Director.instance.CharaContainerScript[0];
|
||||
SkirtSurfaceCollisionSolver solver = firstCharacter != null
|
||||
? firstCharacter.GetComponent<SkirtSurfaceCollisionSolver>() : null;
|
||||
GUILayout.Label(solver != null
|
||||
? "Skirt rings: " + solver.RingCount + " colliders: " + solver.ColliderCount +
|
||||
" contacts: " + solver.LastContactCount
|
||||
: "Skirt surface solver: not initialized");
|
||||
if (firstCharacter != null)
|
||||
{
|
||||
foreach (DynamicBoneCollider collider in firstCharacter.GetComponentsInChildren<DynamicBoneCollider>(true))
|
||||
{
|
||||
if (!IsBodySkirtCollider(collider))
|
||||
continue;
|
||||
|
||||
GUILayout.Label(collider.ColliderName + " r=" + collider.m_Radius.ToString("0.000") +
|
||||
" h=" + collider.m_Height.ToString("0.000"));
|
||||
}
|
||||
}
|
||||
GUILayout.Label("F8: close");
|
||||
GUILayout.EndArea();
|
||||
}
|
||||
|
||||
private static bool SliderRow(string label, ref float value, float min, float max)
|
||||
{
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label(label, GUILayout.Width(105));
|
||||
float updated = GUILayout.HorizontalSlider(value, min, max, GUILayout.Width(165));
|
||||
GUILayout.Label(updated.ToString("0.00") + "x", GUILayout.Width(55));
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
bool changed = !Mathf.Approximately(value, updated);
|
||||
value = updated;
|
||||
return changed;
|
||||
}
|
||||
|
||||
private void Apply()
|
||||
{
|
||||
foreach (ParticleDefaults defaults in _particles)
|
||||
{
|
||||
DynamicBone.Particle particle = defaults.Particle;
|
||||
if (particle == null)
|
||||
continue;
|
||||
|
||||
float categoryDamping = 1f;
|
||||
float categoryElasticity = 1f;
|
||||
float categoryStiffness = 1f;
|
||||
float categoryInert = 1f;
|
||||
if (defaults.Category == MotionCategory.Other)
|
||||
{
|
||||
categoryDamping = _otherDampingScale;
|
||||
categoryElasticity = _otherElasticityScale;
|
||||
categoryStiffness = _otherStiffnessScale;
|
||||
categoryInert = _otherInertScale;
|
||||
}
|
||||
|
||||
particle.m_Damping = Mathf.Clamp01(defaults.Damping * _dampingScale * categoryDamping);
|
||||
particle.m_Elasticity = Mathf.Clamp01(defaults.Elasticity * _elasticityScale * categoryElasticity);
|
||||
particle.m_Stiffness = Mathf.Clamp01(defaults.Stiffness * _stiffnessScale * categoryStiffness);
|
||||
particle.m_Inert = Mathf.Clamp01(defaults.Inert * _inertScale * categoryInert);
|
||||
|
||||
if (defaults.Category == MotionCategory.Other && _otherRigidity > 0f)
|
||||
{
|
||||
// Multipliers alone cannot make a low-value source spring rigid.
|
||||
// This is a direct, non-skirt constraint preset: high damping and
|
||||
// stiffness, with limited rebound and body-motion lag.
|
||||
particle.m_Damping = Mathf.Max(particle.m_Damping, Mathf.Lerp(0f, 0.9f, _otherRigidity));
|
||||
particle.m_Stiffness = Mathf.Max(particle.m_Stiffness, Mathf.Lerp(0f, 0.98f, _otherRigidity));
|
||||
particle.m_Elasticity = Mathf.Min(particle.m_Elasticity, Mathf.Lerp(1f, 0.05f, _otherRigidity));
|
||||
particle.m_Inert = Mathf.Min(particle.m_Inert, Mathf.Lerp(1f, 0f, _otherRigidity));
|
||||
}
|
||||
}
|
||||
|
||||
foreach (ColliderDefaults defaults in _hipColliders)
|
||||
{
|
||||
if (defaults.Collider != null)
|
||||
defaults.Collider.m_Radius = defaults.Radius * _hipRadiusScale;
|
||||
}
|
||||
|
||||
foreach (ColliderDefaults defaults in _legColliders)
|
||||
{
|
||||
if (defaults.Collider != null)
|
||||
defaults.Collider.m_Radius = defaults.Radius * _legRadiusScale;
|
||||
}
|
||||
|
||||
if (Director.instance == null)
|
||||
return;
|
||||
|
||||
foreach (UmaContainerCharacter character in Director.instance.CharaContainerScript)
|
||||
{
|
||||
if (character == null)
|
||||
continue;
|
||||
|
||||
SkirtSurfaceCollisionSolver solver = character.GetComponent<SkirtSurfaceCollisionSolver>();
|
||||
if (solver != null)
|
||||
solver.HorizontalStiffness = _horizontalStiffness;
|
||||
}
|
||||
|
||||
foreach (StageMonitorDriver monitorDriver in Object.FindObjectsOfType<StageMonitorDriver>(true))
|
||||
monitorDriver.brightnessMultiplier = _monitorBrightness;
|
||||
}
|
||||
|
||||
private void SetSkirtBodyCollisionEnabled(bool enabled)
|
||||
{
|
||||
foreach (UmaContainerCharacter character in Director.instance.CharaContainerScript)
|
||||
{
|
||||
if (character == null)
|
||||
continue;
|
||||
|
||||
foreach (DynamicBoneCollider collider in character.GetComponentsInChildren<DynamicBoneCollider>(true))
|
||||
{
|
||||
if (IsBodySkirtCollider(collider))
|
||||
collider.enabled = enabled;
|
||||
}
|
||||
|
||||
SkirtSurfaceCollisionSolver solver = character.GetComponent<SkirtSurfaceCollisionSolver>();
|
||||
if (solver != null)
|
||||
solver.enabled = enabled;
|
||||
character.ResetDynamicBone();
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsBodySkirtCollider(DynamicBoneCollider collider)
|
||||
{
|
||||
if (collider == null || string.IsNullOrEmpty(collider.ColliderName) ||
|
||||
collider.ColliderName.IndexOf("Skirt", System.StringComparison.OrdinalIgnoreCase) < 0)
|
||||
return false;
|
||||
|
||||
if (collider.ColliderName.IndexOf("Thigh", System.StringComparison.OrdinalIgnoreCase) >= 0)
|
||||
return true;
|
||||
|
||||
bool isSideHip = collider.ColliderName.EndsWith("_L", System.StringComparison.OrdinalIgnoreCase) ||
|
||||
collider.ColliderName.EndsWith("_R", System.StringComparison.OrdinalIgnoreCase);
|
||||
return collider.ColliderName.IndexOf("Hip", System.StringComparison.OrdinalIgnoreCase) >= 0 &&
|
||||
isSideHip && collider.m_Radius <= 0.25f;
|
||||
}
|
||||
|
||||
private static bool IsHipSkirtCollider(DynamicBoneCollider collider)
|
||||
{
|
||||
return collider != null && collider.ColliderName != null &&
|
||||
collider.ColliderName.IndexOf("Hip", System.StringComparison.OrdinalIgnoreCase) >= 0 &&
|
||||
collider.ColliderName.IndexOf("Skirt", System.StringComparison.OrdinalIgnoreCase) >= 0 &&
|
||||
(collider.ColliderName.EndsWith("_L", System.StringComparison.OrdinalIgnoreCase) ||
|
||||
collider.ColliderName.EndsWith("_R", System.StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
private static bool IsLegSkirtCollider(DynamicBoneCollider collider)
|
||||
{
|
||||
return collider != null && collider.ColliderName != null &&
|
||||
collider.ColliderName.IndexOf("Thigh", System.StringComparison.OrdinalIgnoreCase) >= 0 &&
|
||||
collider.ColliderName.IndexOf("MSkirt", System.StringComparison.OrdinalIgnoreCase) >= 0;
|
||||
}
|
||||
|
||||
private static MotionCategory GetMotionCategory(DynamicBone dynamicBone)
|
||||
{
|
||||
string name = GetMotionName(dynamicBone);
|
||||
return dynamicBone != null && (dynamicBone.m_ContinuousCollision ||
|
||||
name.IndexOf("Skirt", System.StringComparison.OrdinalIgnoreCase) >= 0)
|
||||
? MotionCategory.Skirt : MotionCategory.Other;
|
||||
}
|
||||
|
||||
private static string GetMotionName(DynamicBone dynamicBone)
|
||||
{
|
||||
string name = dynamicBone != null && dynamicBone.m_Root != null
|
||||
? dynamicBone.m_Root.name : string.Empty;
|
||||
for (Transform transform = dynamicBone != null ? dynamicBone.transform.parent : null;
|
||||
transform != null; transform = transform.parent)
|
||||
{
|
||||
name += "/" + transform.name;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 65925dd2ac8aec44a9998f1d12dd2b2d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user