void Update() { if (!m_baking || m_TrsArr == null || m_TrsArr.Length == 0) { return; } double t = EditorApplication.timeSinceStartup; if (t - _lastCheckTime > ELAPSE) { _lastCheckTime = t; foreach (var xfdata in m_Trs) { if (xfdata.HasDiff()) { XformData tmpData = XformData.Create(xfdata.tr); xfdata.Apply(); Undo.RecordObject(xfdata.tr, "baking"); tmpData.Apply(xfdata.tr); xfdata.CopyFrom(); //update saved data } } } }
/// <summary> /// record recursively /// </summary> private void _PrepareBlend(Transform extTr, List <BlendData> blendDatas) { BlendData newData = new BlendData(); newData.m_Tr = extTr; newData.m_StartTrData = XformData.Create(extTr); blendDatas.Add(newData); for (int idx = 0; idx < extTr.childCount; ++idx) { Transform tr = extTr.GetChild(idx); _PrepareBlend(tr, blendDatas); } }