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; } } } }
override public void Annihilate(bool forced) { if (destroyed) { return; } else { destroyed = true; } if (forced) { UnsetBasement(); } PrepareWorkbuildingForDestruction(forced); if (current == this) { current = null; } if (subscribedToUpdate) { GameMaster.realMaster.labourUpdateEvent -= LabourUpdate; subscribedToUpdate = false; } Destroy(gameObject); }
public void ActivateRollingShopPanel() { UIWorkbuildingObserver wbo = WorkBuilding.workbuildingObserver; if (wbo != null && wbo.gameObject.activeSelf) { // уу, костыли! // и вообще надо переделать на dropdown RollingShop rs = wbo.observingWorkbuilding as RollingShop; if (rs != null) { rollingShopPanel.SetActive(true); rollingShopPanel.transform.GetChild(rs.GetModeIndex()).GetComponent <Toggle>().isOn = true; } } rollingShopPanel.SetActive(true); }
override public void SetBasement(SurfaceBlock b, PixelPosByte pos) { if (b == null) { return; } SetBuildingData(b, pos); if (!subscribedToUpdate) { GameMaster.realMaster.labourUpdateEvent += LabourUpdate; subscribedToUpdate = true; } if (current != null & current != this) { current.Annihilate(false); } current = this; }