public override void OnLevelUnloading()
 {
     base.OnLevelUnloading();
     var go = GameObject.Find(GO_NAME);
     if (go != null)
     {
         Object.Destroy(go);
     }
     if (tabs != null)
     {
         Object.Destroy(tabs);
         tabs = null;
     }
 }
        public override void OnLevelLoaded(LoadMode mode)
        {
            base.OnLevelLoaded(mode);

            if (mode != LoadMode.NewGame && mode != LoadMode.LoadGame)
            {
                return;
            }
            if (tabs == null)
            {
                tabs = (SubBuildingsTabstrip)UIView.GetAView().AddUIComponent(typeof(SubBuildingsTabstrip));
            }
            var subBuildingsMonitor = new GameObject(GO_NAME);
            subBuildingsMonitor.AddComponent<SubBuildingsMonitor>();
        }
 public void Update()
 {
     if (servicePanel == null || zonedPanel == null)
     {
         return;
     }
     Tabs = UIView.Find<SubBuildingsTabstrip>("SubBuildingsTabstrip");
     ushort buildingId = 0;
     if (servicePanelUi.isVisible)
     {
         buildingId = GetServiceInstanceId().Building;
     }
     else if (zonedPanelUi.isVisible)
     {
         buildingId = GetZonedInstanceId().Building;
     }
     if (buildingId == cachedBuildingId)
     {
         return;
     }
     Tabs.UpdateInfoPanelTabs(buildingId);
     cachedBuildingId = buildingId;
 }