﻿using UnityEditor;
using UnityEngine;

namespace SpaceTrader.Util.EditorUtil {
    public static class AspectRatioLayoutSwitcherEditor {
        [MenuItem("SpaceTrader/Refresh All Layout Switchers")]
        private static void RefreshAllSwitchersInScene() {
            var switchers = Object.FindObjectsOfType<AspectRatioLayoutSwitcher>();
            foreach (var switcher in switchers) {
                if (switcher.isActiveAndEnabled) {
                    switcher.SendMessage("OnRectTransformDimensionsChange");

                    Debug.Log($"refreshed layout of {switcher.name}", switcher);
                }
            }
        }
    }
}
﻿using UnityEditor;
using UnityEngine;

namespace SpaceTrader.Util.EditorUtil {
    public static class AspectRatioLayoutSwitcherEditor {
        [MenuItem("Tools/SpaceTrader/Refresh All Layout Switchers")]
        private static void RefreshAllSwitchersInScene() {
            var switchers = Object.FindObjectsOfType<AspectRatioLayoutSwitcher>();
            foreach (var switcher in switchers) {
                if (switcher.isActiveAndEnabled) {
                    switcher.SendMessage("OnRectTransformDimensionsChange");

                    Debug.Log($"refreshed layout of {switcher.name}", switcher);
                }
            }
        }
    }
}

Fix layout switcher tool menu path
Fix layout switcher tool menu path
