public override void Play(int currentClip) { if (currentClip >= m_ClipList.Count) { return; } TransformRecordData data = m_ClipList[currentClip] as TransformRecordData; transform.position = data.position; transform.rotation = data.rotation; // transform.lossyScale = data.scale; // scale wont change during playing }
private void Awake() { recordDatas = new TransformRecordData[recordTrans.Length]; for (int i = 0; i < recordTrans.Length; i++) { Transform target = recordTrans[i]; TransformRecordData data = new TransformRecordData() { target = target, parent = target.parent, siblingIndex = target.GetSiblingIndex(), localPos = target.localPosition, localEuler = target.localEulerAngles, localScale = target.localScale }; recordDatas[i] = data; } }