private void OnApplicationQuit() { if (action == Action.RECORD_MOVEMENT) { Debug.Log("Saveing..."); recorder.SaveToClip((AnimationClip)animController.layers[0].stateMachine.defaultState.motion); recorder.ResetRecording(); //UnityEditor.AssetDatabase.SaveAssets(); Debug.Log("Saved"); } }
void LateUpdate() { if (clip == null) { return; } if (record) { _recorder.TakeSnapshot(Time.deltaTime * Keyframe); } else if (_recorder.isRecording) { _recorder.SaveToClip(clip); _recorder.ResetRecording(); UnityEditor.AssetDatabase.CreateAsset(clip, filePath + ".anim"); Debug.Log("Save Succeed"); } }