static void OnRuntimeInitialize() { #if UNITY_EDITOR // load settings asset path from editor prefs. var settingsAssetPath = UnityEditor.EditorPrefs.GetString(PathKey, string.Empty); if (string.IsNullOrEmpty(settingsAssetPath)) { return; } instance = UnityEditor.AssetDatabase.LoadAssetAtPath(settingsAssetPath, typeof(TransformRecorderSettings)) as TransformRecorderSettings; #endif }
void Start() { clip = TransformRecorderSettings.GetAnimationClip(animationClipIndex); if (null == clip) { Destroy(this); return; } switch (mode) { case Mode.Record: break; case Mode.Playback: var anim = gameObject.AddComponent <Animation>(); anim.clip = clip; anim.AddClip(clip, clip.name); anim.Play(); break; } }