live motion support
This commit is contained in:
@@ -19,6 +19,10 @@ namespace Gallop.Live.Cutt
|
||||
public const float BaseCharaHeightMax = 190;
|
||||
public const float BaseCharaHeightDiff = 60;
|
||||
|
||||
private LiveTimelineMotionSequence[] _motionSequenceArray;
|
||||
|
||||
public LiveTimelineKeyCharaMotionSeqDataList[] _keyArray;
|
||||
|
||||
public void CopyValues<T>(T from, T to)
|
||||
{
|
||||
var json = JsonUtility.ToJson(from);
|
||||
@@ -44,6 +48,55 @@ namespace Gallop.Live.Cutt
|
||||
// CopyValues(worksheet, LoadSheet);
|
||||
//}
|
||||
}
|
||||
|
||||
public void InitCharaMotionSequence()
|
||||
{
|
||||
//Create Animation
|
||||
foreach (var obj in Director.instance.charaObjs)
|
||||
{
|
||||
var container = obj.GetComponentInChildren<UmaContainer>();
|
||||
if (container)
|
||||
{
|
||||
var animation = container.gameObject.AddComponent<Animation>();
|
||||
Director.instance.charaAnims.Add(animation);
|
||||
}
|
||||
}
|
||||
|
||||
//Get KeyArray
|
||||
var listCount = data.worksheetList[0].charaMotSeqList.Count;
|
||||
|
||||
_keyArray = new LiveTimelineKeyCharaMotionSeqDataList[listCount];
|
||||
|
||||
for (int i = 0; i < listCount; i++)
|
||||
{
|
||||
_keyArray[i] = data.worksheetList[0].charaMotSeqList[i].keys;
|
||||
}
|
||||
|
||||
//Set Motion
|
||||
int CharaPositionMax = characterStandPosLocators.Length;
|
||||
|
||||
_motionSequenceArray = new LiveTimelineMotionSequence[CharaPositionMax];
|
||||
|
||||
for (int i = 0; i < CharaPositionMax; i++)
|
||||
{
|
||||
_motionSequenceArray[i] = new LiveTimelineMotionSequence();
|
||||
_motionSequenceArray[i].Initialize(Director.instance.charaObjs[i], i, i, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void AlterUpdate(float liveTime)
|
||||
{
|
||||
AlterUpdate_CharaMotionSequence(liveTime);
|
||||
}
|
||||
|
||||
public void AlterUpdate_CharaMotionSequence(float liveTime)
|
||||
{
|
||||
foreach (var motion in _motionSequenceArray)
|
||||
{
|
||||
motion.AlterUpdate(liveTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user