public void RollingShop_SetActivity(int x) { UIWorkbuildingObserver wbo = WorkBuilding.workbuildingObserver; if (wbo == null | !wbo.gameObject.activeSelf) { DeactivateRollingShopPanel(); return; } else // уу, костыли! { RollingShop rs = wbo.observingWorkbuilding as RollingShop; if (rs == null) { DeactivateRollingShopPanel(); return; } else { if (rs.GetModeIndex() != x) { rs.SetMode(x); rollingShopPanel.transform.GetChild(x).GetComponent <Toggle>().isOn = true; } } } }