private void OnEnable()
 {
     skin = (GUISkin)Resources.Load(EasyMotionConstants.pluginSkin);
     availableRigidBodies = EasyMotionUtility.FindActiveRigidbodies();
     PopulatePreviewDictionary();
     currentScene = SceneManager.GetActiveScene().name;
     EditorApplication.hierarchyChanged += HierarchyWindowChanged;
     easyMotions = EasyMotionUtility.FindActiveEnabledEasyMotions();
 }
 private void DestroyAllEasyMotionInstances()
 {
     foreach (EasyMotion script in easyMotions)
     {
         DestroyImmediate(script);
     }
     EditorSceneManager.MarkSceneDirty(SceneManager.GetActiveScene());
     easyMotions = EasyMotionUtility.FindActiveEnabledEasyMotions();
 }
    private bool FindAnyEasyMotionScript()
    {
        bool foundScript = false;

        EasyMotionToggleController[]             toggleScripts = EasyMotionUtility.FindActiveEnabledToggleControllers();
        EasyMotionSerialPortDropdownController[] portScripts   = EasyMotionUtility.FindActiveEnabledDropdownControllers();
        EasyMotion[] easyMotionScripts             = EasyMotionUtility.FindActiveEnabledEasyMotions();
        EasyMotionSliderController[] sliderScripts = EasyMotionUtility.FindActiveEnabledSliderControllers();

        if (toggleScripts.Length > 0 || portScripts.Length > 0 || easyMotionScripts.Length > 0 || sliderScripts.Length > 0)
        {
            foundScript = true;
        }
        return(foundScript);
    }