/// editor OnInspectorGUI to control the NIEventLogger properties
    override public void OnInspectorGUI()
    {
        EditorGUI.indentLevel = 0;
        EditorGUIUtility.LookLikeInspector();
        NIUserPoseGestureFactory detector = target as NIUserPoseGestureFactory;

        string[] legalPoses = NIUserAndSkeleton.GetLegalPoses();

        if (legalPoses != null)
        {
            int selectedIndex;
            if (detector.m_poseName == null)
            {
                selectedIndex = 0;
            }
            else
            {
                for (selectedIndex = 0; selectedIndex < legalPoses.Length; selectedIndex++)
                {
                    if (detector.m_poseName.CompareTo(legalPoses[selectedIndex]) == 0)
                    {
                        break;
                    }
                }
            }
            if (selectedIndex >= legalPoses.Length)
            {
                selectedIndex = 0;
            }
            selectedIndex       = EditorGUILayout.Popup("pose to detect", selectedIndex, legalPoses);
            detector.m_poseName = legalPoses[selectedIndex];
        }
        else
        {
            EditorGUILayout.LabelField("Pose to detect", detector.m_poseName);
        }

        detector.m_timeToHoldPose = EditorGUILayout.FloatField("Time to hold pose", detector.m_timeToHoldPose);
        if (detector.m_timeToHoldPose < 0)
        {
            detector.m_timeToHoldPose = 0;
        }

        detector.m_Context = EditorGUILayout.ObjectField("Context", detector.m_Context, typeof(OpenNISettingsManager), true) as OpenNISettingsManager;


        if (EditorApplication.isPlaying == false)
        {
            if (GUILayout.Button("Update legal poses (might take some time)"))
            {
                OpenNISettingsManager.InspectorReloadAnInstance();
            }
        }

        if (GUI.changed)
        {
            EditorUtility.SetDirty(target);
        }
    }
    protected override void DrawPlayerManager()
    {
        base.DrawPlayerManager();
        AS_UNIPlayerManagerPoseSelection manager = target as AS_UNIPlayerManagerPoseSelection;

        string[] legalPose = UNIUserAndSkeleton.GetLegalPoses();
        if (legalPose != null)
        {
            int selectedIndex;
            if (manager.m_PoseToSelect == null)
            {
                selectedIndex = 0;
            }
            else
            {
                for (selectedIndex = 0; selectedIndex < legalPose.Length; selectedIndex++)
                {
                    if (manager.m_PoseToSelect.CompareTo(legalPose[selectedIndex]) == 0)
                    {
                        break;
                    }
                }
            }
            if (selectedIndex >= legalPose.Length)
            {
                selectedIndex = 0;
            }
            selectedIndex          = EditorGUILayout.Popup("Pose to select", selectedIndex, legalPose);
            manager.m_PoseToSelect = legalPose[selectedIndex];

            bool useUnselectionPose = manager.m_PoseToUnselect != null && manager.m_PoseToUnselect.CompareTo("") != 0;
            useUnselectionPose = EditorGUILayout.Toggle("Use unselection pose", useUnselectionPose);
            if (useUnselectionPose == false)
            {
                manager.m_PoseToUnselect = "";
            }
            else
            {
                if (manager.m_PoseToUnselect == null)
                {
                    selectedIndex = 0;
                }
                else
                {
                    for (selectedIndex = 0; selectedIndex < legalPose.Length; selectedIndex++)
                    {
                        if (legalPose[selectedIndex] == manager.m_PoseToUnselect)
                        {
                            break;
                        }
                    }
                }
                if (selectedIndex >= legalPose.Length)
                {
                    selectedIndex = 0;
                }
                selectedIndex            = EditorGUILayout.Popup("Pose to unselect", selectedIndex, legalPose);
                manager.m_PoseToUnselect = legalPose[selectedIndex];
            }
        }
        else
        {
            EditorGUILayout.LabelField("Pose to select", manager.m_PoseToSelect);
            EditorGUILayout.LabelField("pose to unselect", manager.m_PoseToUnselect);
        }

        manager.m_timeToSwitch = EditorGUILayout.FloatField("Time between switching", manager.m_timeToSwitch);
        if (manager.m_timeToSwitch < 0)
        {
            manager.m_timeToSwitch = 0;
        }

        if (EditorApplication.isPlaying == false)
        {
            if (GUILayout.Button("Update legal pose"))
            {
                OpenNISettingsManager.InspectorReloadAnInstance();
            }
        }
    }