private void OnEnable()
    {
        PLG_CameraSequenceAdjustWindow.CloseWindow();

        reorderableList = new ReorderableList(serializedObject, serializedObject.FindProperty("keys"), true, true, true, true);
        reorderableList.drawHeaderCallback     = DrawHeaderCallback;
        reorderableList.drawElementCallback    = DrawElementCallback;
        reorderableList.elementHeightCallback += ElementHeightCallback;
    }
    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        reorderableList.DoLayoutList();

        if (GUILayout.Button("Launch Editor Window"))
        {
            PLG_CameraSequenceAdjustWindow.OpenWindow((SCR_CameraSequence)target);
        }

        serializedObject.ApplyModifiedProperties();
    }
    private static void CaptureCameraHelper(Camera cam)
    {
        var selectedCameraSequence = Selection.activeObject as SCR_CameraSequence;

        if (selectedCameraSequence != null)
        {
            selectedCameraSequence.AddCameraKey(cam.transform.position, cam.transform.rotation.eulerAngles);
        }
        else
        {
            var openEditorWindows = Resources.FindObjectsOfTypeAll <PLG_CameraSequenceAdjustWindow>();
            if (openEditorWindows.Length > 0)
            {
                var editedSequences = new List <SCR_CameraSequence>();
                foreach (var window in openEditorWindows)
                {
                    editedSequences.Add(window.targetCameraSequence);
                    window.targetCameraSequence.AddCameraKey(cam.transform.position, cam.transform.rotation.eulerAngles);
                }
                PLG_CameraSequenceAdjustWindow.CloseWindow();
                foreach (var sequence in editedSequences)
                {
                    PLG_CameraSequenceAdjustWindow.OpenWindow(sequence);
                }
            }
            else
            {
                var newSeqenceAsset = CreateInstance <SCR_CameraSequence>();
                newSeqenceAsset.AddCameraKey(cam.transform.position, cam.transform.rotation.eulerAngles);
                var path = AssetDatabase.GenerateUniqueAssetPath("Assets/CameraSequence.asset");
                AssetDatabase.CreateAsset(newSeqenceAsset, path);
                AssetDatabase.Refresh();
                EditorUtility.FocusProjectWindow();
                Selection.activeObject = newSeqenceAsset;
            }
        }
    }