示例#1
0
    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;
                }
            }
        }
    }
示例#2
0
 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);
 }
示例#3
0
    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);
    }
示例#4
0
 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;
 }