public static void SaveSelectedConfig() { var go = Selection.activeGameObject; if (!go) { return; } var cfg = go.GetComponent <ConfigBase>(); if (!cfg) { return; } ConfigSystem.TrySaveSingle(cfg); }