Add Live Effect track (track ID 60) implementation
- LiveTimelineEffectData.cs: new data class with full field set
(color, offset, owner, occurrenceSpot, IsLinkOwner*, etc.)
derived from actual cutt asset bundle TypeTree dump
- LiveTimelineWorkSheet: add effectList field
- LiveTimelineControl: add OnUpdateEffect event and AlterUpdate_EffectControl
- Director: add OnEffectUpdate handler and ApplyEffectTransform helper
loads prefab from 3d/effect/live/pfb_{name}, instantiates per key frame
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -62,6 +62,8 @@ namespace Gallop.Live.Cutt
|
||||
|
||||
public event ObjectUpdateInfoDelegate OnUpdateObject;
|
||||
|
||||
public event Action<LiveTimelineEffectData, LiveTimelineKeyEffectData> OnUpdateEffect;
|
||||
|
||||
private static Func<LiveTimelineKeyCameraPositionData, LiveTimelineControl, FindTimelineConfig, Vector3> fnGetCameraPosValue = GetCameraPosValue;
|
||||
|
||||
private static Func<LiveTimelineKeyCameraLookAtData, LiveTimelineControl, Vector3, FindTimelineConfig, Vector3> fnGetCameraLookAtValue = GetCameraLookAtValue;
|
||||
@@ -341,6 +343,7 @@ namespace Gallop.Live.Cutt
|
||||
AlterUpdate_BgColor1(workSheet, _currentFrame);
|
||||
AlterUpdate_TransformControl(workSheet, _currentFrame);
|
||||
AlterUpdate_ObjectControl(workSheet, _currentFrame);
|
||||
AlterUpdate_EffectControl(workSheet, _currentFrame);
|
||||
|
||||
_isNowAlterUpdate = false;
|
||||
|
||||
@@ -618,7 +621,7 @@ namespace Gallop.Live.Cutt
|
||||
|
||||
|
||||
|
||||
//修改(Live演出的显隐控制和位置变换相关)
|
||||
//��(Live�ݳ����������ƺ�λ�ñ任���)
|
||||
public void LateUpdateFormationOffset_Transform(int targetIndex, LiveTimelineKeyIndex curKeyIndex, float time)
|
||||
{
|
||||
bool ControlMode = UmaViewerUI.Instance != null && UmaViewerUI.Instance.isControlMode;
|
||||
@@ -1158,7 +1161,7 @@ namespace Gallop.Live.Cutt
|
||||
{
|
||||
camera.cacheTransform.position = pos;
|
||||
|
||||
// TODO 这里用的还是CGSS的layer枚举,要进行替换
|
||||
// TODO �����õĻ���CGSS��layerö�٣�Ҫ�����滻
|
||||
/*
|
||||
int num = liveTimelineKeyCameraPositionData.GetCullingMask();
|
||||
if (num == 0)
|
||||
@@ -1823,6 +1826,22 @@ namespace Gallop.Live.Cutt
|
||||
}
|
||||
}
|
||||
|
||||
private void AlterUpdate_EffectControl(LiveTimelineWorkSheet sheet, float currentFrame)
|
||||
{
|
||||
if (sheet.effectList == null || OnUpdateEffect == null) return;
|
||||
int count = sheet.effectList.Count;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var effectData = sheet.effectList[i];
|
||||
var keys = effectData.keys;
|
||||
if (keys == null || keys.HasAttribute(LiveTimelineKeyDataListAttr.Disable) || !keys.EnablePlayModeTimeline(_playMode))
|
||||
continue;
|
||||
FindTimelineKey(out var curKey, out var _, keys, currentFrame);
|
||||
if (curKey == null) continue;
|
||||
OnUpdateEffect.Invoke(effectData, curKey as LiveTimelineKeyEffectData);
|
||||
}
|
||||
}
|
||||
|
||||
private static float LerpWithoutClamp(float a, float b, float t)
|
||||
{
|
||||
return a + (b - a) * t;
|
||||
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Gallop.Live.Cutt
|
||||
{
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyEffectData : LiveTimelineKeyWithInterpolate
|
||||
{
|
||||
public Color color;
|
||||
public float colorPower;
|
||||
public int ColorProperty;
|
||||
public int owner;
|
||||
public int occurrenceSpot;
|
||||
public string ParentStageObjectName;
|
||||
public bool IsAttachProps;
|
||||
public int PropsIndex;
|
||||
public Vector3 offset;
|
||||
public Vector3 offsetAngle;
|
||||
public Vector3 offsetScale;
|
||||
public string BlinkLightName;
|
||||
public int BlinkLightNameHash;
|
||||
public int BlinkLightContainerIndex;
|
||||
public float BlinkLightBrightnessPower;
|
||||
public bool IsAdjustedBlinkLightColor;
|
||||
public bool IsSyncBlinkLight;
|
||||
public bool IsLinkOwnerPositionX;
|
||||
public bool IsLinkOwnerPositionY;
|
||||
public bool IsLinkOwnerPositionZ;
|
||||
public bool IsLinkOwnerRotate;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineKeyEffectDataList : LiveTimelineKeyDataListTemplate<LiveTimelineKeyEffectData>
|
||||
{
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class LiveTimelineEffectData : ILiveTimelineGroupDataWithName
|
||||
{
|
||||
private const string default_name = "Effect";
|
||||
public LiveTimelineKeyEffectDataList keys;
|
||||
}
|
||||
}
|
||||
@@ -634,7 +634,7 @@ namespace Gallop.Live.Cutt
|
||||
public float Timescale;
|
||||
}
|
||||
|
||||
//正在处理这里
|
||||
//���ڴ�������
|
||||
[System.Serializable]
|
||||
public class LiveTimelineKeyCameraPositionData : LiveTimelineKeyWithInterpolate
|
||||
{
|
||||
@@ -915,7 +915,7 @@ namespace Gallop.Live.Cutt
|
||||
[SerializeField] public List<LiveTimelineMultiCameraPositionData> multiCameraPosKeys;
|
||||
[SerializeField] public List<LiveTimelineMultiCameraLookAtData> multiCameraLookAtKeys;
|
||||
|
||||
//[SerializeField]用于该类在别的脚本里定义的时候
|
||||
//[SerializeField]���ڸ����ڱ�Ľű��ﶨ���ʱ��
|
||||
[SerializeField] public LiveTimelineKeyCameraLookAtDataList cameraLookAtKeys;
|
||||
[SerializeField] public LiveTimelineKeyCameraFovDataList cameraFovKeys;
|
||||
[SerializeField] public LiveTimelineKeyCameraRollDataList cameraRollKeys;
|
||||
@@ -936,9 +936,10 @@ namespace Gallop.Live.Cutt
|
||||
|
||||
[SerializeField] public List<LiveTimelineTransformData> transformList;
|
||||
[SerializeField] public List<LiveTimelineObjectData> objectList;
|
||||
[SerializeField] public List<LiveTimelineEffectData> effectList;
|
||||
|
||||
/*
|
||||
//终于可以调用AB包了,虽然后面发现没什么用...说不定什么时候能用到
|
||||
//���ڿ��Ե���AB���ˣ���Ȼ���淢��ûʲô��...˵����ʲôʱ�����õ�
|
||||
private void Start()
|
||||
{
|
||||
LoadCharaMotion();
|
||||
|
||||
Reference in New Issue
Block a user