private void DeleteAllSliderControllerScripts() { EasyMotionSliderController[] sliderScripts = EasyMotionUtility.FindActiveEnabledSliderControllers(); foreach (EasyMotionSliderController script in sliderScripts) { DestroyImmediate(script); } availableSliders = FindActiveSliders(); EditorSceneManager.MarkSceneDirty(SceneManager.GetActiveScene()); }
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); }
private (bool boolean, EasyMotionSliderController sliderScript) SliderExists(string savePath) { bool sliderExists = false; EasyMotionSliderController[] sliders = EasyMotionUtility.FindActiveEnabledSliderControllers(); foreach (EasyMotionSliderController slider in sliders) { if (slider.GetSavePath().Equals(Application.persistentDataPath + savePath)) { sliderExists = true; return(sliderExists, slider); } } return(false, null); }
private void DestroyAllScripts() { EasyMotionToggleController[] toggleScripts = EasyMotionUtility.FindActiveEnabledToggleControllers(); EasyMotionSerialPortDropdownController[] portScripts = EasyMotionUtility.FindActiveEnabledDropdownControllers(); EasyMotionSliderController[] sliderScripts = EasyMotionUtility.FindActiveEnabledSliderControllers(); foreach (EasyMotionToggleController toggleScript in toggleScripts) { DestroyImmediate(toggleScript); } foreach (EasyMotionSerialPortDropdownController portScript in portScripts) { DestroyImmediate(portScript); } foreach (EasyMotionSliderController sliderScript in sliderScripts) { DestroyImmediate(sliderScript); } }