public void SetEntity(CSCommon entity)
    {
        if (entity != null && entity.m_Type != CSConst.etEnhance &&
            entity.m_Type != CSConst.etRepair &&
            entity.m_Type != CSConst.etRecyle)
        {
            Debug.Log("The giving Entity is not allowed!");
            return;
        }

        m_Type   = entity.m_Type;
        m_Entity = entity;
        CSUI_MainWndCtrl.Instance.mSelectedEnntity = m_Entity;

        if (m_Type == CSConst.etEnhance)
        {
            CSEnhance cse = m_Entity as CSEnhance;
            if (cse.m_Item == null)
            {
                SetItem(null);
            }
            else
            {
                SetItem(cse.m_Item.itemObj);
            }
        }
        else if (m_Type == CSConst.etRepair)
        {
            CSRepair csr = m_Entity as CSRepair;
            if (csr.m_Item == null)
            {
                SetItem(null);
            }
            else
            {
                SetItem(csr.m_Item.itemObj);
            }
        }
        else if (m_Type == CSConst.etRecyle)
        {
            CSRecycle csr = m_Entity as CSRecycle;
            if (csr.m_Item == null)
            {
                SetItem(null);
            }
            else
            {
                SetItem(csr.m_Item.itemObj);
            }
        }
    }
    void OnItemChanged(ItemObject item)
    {
        if (m_Type == CSConst.etEnhance)
        {
            CSEnhance cse = m_Entity as CSEnhance;
            cse.m_Item = m_enhanceItem;

            m_EnhanceProperty.m_Root.gameObject.SetActive(true);
            m_RepairProperty.m_Root.gameObject.SetActive(false);
            m_RecycleProperty.m_Root.gameObject.SetActive(false);

            if (onEnhancedItemChanged != null)
            {
                onEnhancedItemChanged(item);
            }
        }
        else if (m_Type == CSConst.etRepair)
        {
            CSRepair csr = m_Entity as CSRepair;
            csr.m_Item = m_repairItem;

            m_EnhanceProperty.m_Root.gameObject.SetActive(false);
            m_RepairProperty.m_Root.gameObject.SetActive(true);
            m_RecycleProperty.m_Root.gameObject.SetActive(false);

            if (onRepairedItemChanged != null)
            {
                onRepairedItemChanged(item);
            }
        }
        else if (m_Type == CSConst.etRecyle)
        {
            CSRecycle csr = m_Entity as CSRecycle;
            csr.m_Item = m_recycleItem;

            m_EnhanceProperty.m_Root.gameObject.SetActive(false);
            m_RepairProperty.m_Root.gameObject.SetActive(false);
            m_RecycleProperty.m_Root.gameObject.SetActive(true);

            if (onRecycleItemChanged != null)
            {
                onRecycleItemChanged(item);
            }
        }
    }
Esempio n. 3
0
    // <CETC> Create Non-Managed Entity
    public override int CreateEntity(CSEntityAttr attr, out CSEntity outEnti)
    {
        outEnti = null;

        if (attr.m_Type == CSConst.etAssembly)
        {
            Debug.LogWarning("Non-Managed Creator cant create the Assembly Entity.");
            return(CSConst.rrtUnkown);
        }

        if (m_CommonEntities.ContainsKey(attr.m_InstanceId))
        {
            outEnti                  = m_CommonEntities[attr.m_InstanceId];
            outEnti.gameObject       = attr.m_Obj;
            outEnti.Position         = attr.m_Pos;
            outEnti.ItemID           = attr.m_protoId;
            outEnti.BaseData.m_Alive = true;
            return(CSConst.rrtSucceed);
        }

        CSCommon csc = null;

        switch (attr.m_Type)
        {
        case CSConst.etStorage:
            csc = new CSStorage();
            CSStorage css = csc as CSStorage;
            css.m_Info    = CSInfoMgr.m_StorageInfo;
            css.m_Creator = this;
            css.m_Power   = attr.m_Power;
            css.m_Package.ExtendPackage(CSInfoMgr.m_StorageInfo.m_MaxItem, CSInfoMgr.m_StorageInfo.m_MaxEquip, CSInfoMgr.m_StorageInfo.m_MaxRecource, CSInfoMgr.m_StorageInfo.m_MaxArmor);
            break;

        case CSConst.etEnhance:
            csc = new CSEnhance();
            CSEnhance csen = csc as CSEnhance;
            csen.m_Creator = this;
            csen.m_Power   = attr.m_Power;
            csen.m_Info    = CSInfoMgr.m_EnhanceInfo;
            break;

        case CSConst.etRepair:
            csc = new CSRepair();
            CSRepair csr = csc as CSRepair;
            csr.m_Creator = this;
            csr.m_Power   = attr.m_Power;
            csr.m_Info    = CSInfoMgr.m_RepairInfo;
            break;

        case CSConst.etRecyle:
            csc = new CSRecycle();
            CSRecycle csrc = csc as CSRecycle;
            csrc.m_Creator = this;
            csrc.m_Power   = attr.m_Power;
            csrc.m_Info    = CSInfoMgr.m_RecycleInfo;
            break;

        case CSConst.etDwelling:
            csc = new CSDwellings();
            CSDwellings csd = csc as CSDwellings;
            csd.m_Creator = this;
            csd.m_Power   = attr.m_Power;;
            csd.m_Info    = CSInfoMgr.m_DwellingsInfo;
            break;

        case CSConst.etppCoal:
            csc = new CSPPCoal();
            CSPPCoal cscppc = csc as CSPPCoal;
            cscppc.m_Creator   = this;
            cscppc.m_Power     = 10000;
            cscppc.m_RestPower = 10000;
            cscppc.m_Info      = CSInfoMgr.m_ppCoal;
            break;

        case CSConst.etppSolar:
            csc = new CSPPSolar();
            CSPPSolar cspps = csc as CSPPSolar;
            cspps.m_Creator   = this;
            cspps.m_Power     = 10000;
            cspps.m_RestPower = 10000;
            cspps.m_Info      = CSInfoMgr.m_ppCoal;
            break;

        case CSConst.etFactory:
            csc           = new CSFactory();
            csc.m_Creator = this;
            csc.m_Info    = CSInfoMgr.m_FactoryInfo;
            break;

        default:
            break;
        }

        csc.ID = attr.m_InstanceId;
        csc.CreateData();
        csc.gameObject = attr.m_Obj;
        csc.Position   = attr.m_Pos;
        csc.ItemID     = attr.m_protoId;

        outEnti = csc;
        m_CommonEntities.Add(attr.m_InstanceId, csc);
        return(CSConst.rrtSucceed);
    }
Esempio n. 4
0
    public void Replace(List <CSEntity> commons, CSEntity selectEntity)
    {
        List <CSCommon> commons_list = new List <CSCommon>();

        if (m_Enhance != null)
        {
            commons_list.Add(m_Enhance);
        }
        if (m_Repair != null)
        {
            commons_list.Add(m_Repair);
        }
        if (m_Recycle != null)
        {
            commons_list.Add(m_Recycle);
        }

        bool replace = false;

        if (commons.Count != commons_list.Count)
        {
            replace = true;
        }
        else
        {
            for (int i = 0; i < commons.Count; i++)
            {
                if (!commons_list.Contains(commons[i] as CSCommon))
                {
                    replace = true;
                    break;
                }
            }
        }

        if (replace)
        {
            if (m_Enhance != null)
            {
                m_MenuPart.m_EnhanceCB.gameObject.SetActive(false);
                m_Enhance.onEnhancedTimeUp = null;
                m_Enhance = null;
            }

            if (m_Repair != null)
            {
                m_MenuPart.m_RepairCB.gameObject.SetActive(false);
                m_Repair.onRepairedTimeUp = null;
                m_Repair = null;
            }

            if (m_Recycle != null)
            {
                m_MenuPart.m_RecyleCB.gameObject.SetActive(false);
                m_Recycle = null;
            }

            foreach (CSCommon csc in commons)
            {
                AddMachine(csc);
            }

            CSUI_CommonIcon Icon = m_MenuPart.m_EnhanceCB.gameObject.GetComponent <CSUI_CommonIcon>();
            Icon.Common = m_Enhance as CSCommon;

            Icon        = m_MenuPart.m_RepairCB.gameObject.GetComponent <CSUI_CommonIcon>();
            Icon.Common = m_Repair as CSCommon;

            Icon        = m_MenuPart.m_RecyleCB.gameObject.GetComponent <CSUI_CommonIcon>();
            Icon.Common = m_Recycle as CSCommon;
        }

        if (null == selectEntity)
        {
            if (m_Enhance != null)
            {
                m_CurType = CSConst.etEnhance;
            }
            else if (m_Recycle != null)
            {
                m_CurType = CSConst.etRecyle;
            }
            else if (m_Repair != null)
            {
                m_CurType = CSConst.etRepair;
            }
        }
        else
        {
            //lz-2016.10.17 从那个Entity打开就选中哪个
            if (m_Enhance != null && selectEntity == m_Enhance)
            {
                m_CurType = CSConst.etEnhance;
            }
            else if (m_Recycle != null && selectEntity == m_Recycle)
            {
                m_CurType = CSConst.etRecyle;
            }
            else if (m_Repair != null && selectEntity == m_Repair)
            {
                m_CurType = CSConst.etRepair;
            }
        }
        SelectByType();
    }
Esempio n. 5
0
    public void RemoveMachine(CSEntity entity)
    {
        if (entity == m_Enhance)
        {
            if (m_MenuPart.m_EnhanceCB.isChecked)
            {
                if (m_MenuPart.m_RepairCB.gameObject.activeSelf)
                {
                    m_CurType = CSConst.etRepair;
                }
                else if (m_MenuPart.m_RecyleCB.gameObject.activeSelf)
                {
                    m_CurType = CSConst.etRecyle;
                }
                else
                {
                    m_CurType = CSConst.etUnknow;
                }

                OnEnable();
            }

            m_MenuPart.m_EnhanceCB.gameObject.SetActive(false);
            m_Enhance.onEnhancedTimeUp = null;
            m_Enhance = null;
        }
        else if (entity == m_Repair)
        {
            if (m_MenuPart.m_RepairCB.isChecked)
            {
                if (m_MenuPart.m_EnhanceCB.gameObject.activeSelf)
                {
                    m_CurType = CSConst.etEnhance;
                }
                else if (m_MenuPart.m_RecyleCB.gameObject.activeSelf)
                {
                    m_CurType = CSConst.etRecyle;
                }
                else
                {
                    m_CurType = CSConst.etUnknow;
                }

                OnEnable();
            }

            m_MenuPart.m_RepairCB.gameObject.SetActive(false);
            m_Repair.onRepairedTimeUp = null;
            m_Repair = null;
        }
        else if (entity == m_Recycle)
        {
            if (m_MenuPart.m_RecyleCB.isChecked)
            {
                if (m_MenuPart.m_EnhanceCB.gameObject.activeSelf)
                {
                    m_CurType = CSConst.etEnhance;
                }
                else if (m_MenuPart.m_RepairCB.gameObject.activeSelf)
                {
                    m_CurType = CSConst.etRepair;
                }
                else
                {
                    m_CurType = CSConst.etUnknow;
                }

                if (gameObject.activeInHierarchy)
                {
                    OnEnable();
                }
            }

            m_MenuPart.m_RecyleCB.gameObject.SetActive(false);
            m_Recycle = null;
        }


        m_MenuPart.m_Root.repositionNow = true;
    }
Esempio n. 6
0
    public void AddMachine(CSEntity entity)
    {
        if (entity.m_Type == CSConst.etEnhance)
        {
            if (m_Enhance != null)
            {
                if (!entity.IsRunning)
                {
                    Debug.LogWarning("The enhanced machine is already exist!");
                    return;
                }
            }

            m_Enhance = entity as CSEnhance;

            m_MenuPart.m_EnhanceCB.gameObject.SetActive(true);
            if (m_MenuPart.m_EnhanceCB.isChecked)
            {
                m_SubEngneering.SetEntity(m_Enhance);
            }

            m_Enhance.onEnhancedTimeUp = OnEnhancedTimeUp;
        }
        else if (entity.m_Type == CSConst.etRepair)
        {
            if (m_Repair != null)
            {
                if (!entity.IsRunning)
                {
                    Debug.LogWarning("The repair machine is already exist!");
                    return;
                }
            }

            m_Repair = entity as CSRepair;

            m_MenuPart.m_RepairCB.gameObject.SetActive(true);
            if (m_MenuPart.m_RepairCB.isChecked)
            {
                m_SubEngneering.SetEntity(m_Repair);
            }

            m_Repair.onRepairedTimeUp = OnRepairedTimeUp;
        }
        else if (entity.m_Type == CSConst.etRecyle)
        {
            if (m_Recycle != null)
            {
                if (!entity.IsRunning)
                {
                    Debug.LogWarning("The recycle machine is already exist!");
                    return;
                }
            }

            m_Recycle = entity as CSRecycle;

            m_MenuPart.m_RecyleCB.gameObject.SetActive(true);
            if (m_MenuPart.m_RecyleCB.isChecked)
            {
                m_SubEngneering.SetEntity(m_Recycle);
            }

            m_Recycle.onRecylced = OnRecycled;
        }

        m_MenuPart.m_Root.repositionNow = true;
    }
Esempio n. 7
0
    CSCommon _CreateCommon(int type)
    {
        CSCommon csc = null;

        switch (type)
        {
        case CSConst.etStorage:
            csc = new CSStorage();
            CSStorage css = csc as CSStorage;
            css.m_Info    = CSInfoMgr.m_StorageInfo;
            css.m_Creator = this;
            css.m_Package.ExtendPackage(CSInfoMgr.m_StorageInfo.m_MaxItem, CSInfoMgr.m_StorageInfo.m_MaxEquip, CSInfoMgr.m_StorageInfo.m_MaxRecource, CSInfoMgr.m_StorageInfo.m_MaxArmor);
            break;

        case CSConst.etEnhance:
            csc = new CSEnhance();
            CSEnhance csen = csc as CSEnhance;
            csen.m_Creator = this;
            csen.m_Info    = CSInfoMgr.m_EnhanceInfo;
            break;

        case CSConst.etRepair:
            csc = new CSRepair();
            CSRepair csr = csc as CSRepair;
            csr.m_Creator = this;
            csr.m_Info    = CSInfoMgr.m_RepairInfo;
            break;

        case CSConst.etRecyle:
            csc = new CSRecycle();
            CSRecycle csrc = csc as CSRecycle;
            csrc.m_Creator = this;
            csrc.m_Info    = CSInfoMgr.m_RecycleInfo;
            break;

        case CSConst.etDwelling:
            csc = new CSDwellings();
            CSDwellings csd = csc as CSDwellings;
            csd.m_Creator = this;
            csd.m_Info    = CSInfoMgr.m_DwellingsInfo;

            // Find the npc to live
            if (!PeGameMgr.IsMulti)
            {
                int index = 0;
                foreach (KeyValuePair <int, CSCommon> kvp in m_CommonEntities)
                {
                    if (index >= csd.m_NPCS.Length)
                    {
                        break;
                    }

                    if (kvp.Value.m_Type == CSConst.etDwelling)
                    {
                        CSDwellings dwellings = kvp.Value as CSDwellings;
                        if (dwellings.IsRunning)
                        {
                            continue;
                        }
                        for (int i = 0; i < dwellings.m_NPCS.Length; i++)
                        {
                            if (dwellings.m_NPCS[i] != null)
                            {
                                csd.AddNpcs(dwellings.m_NPCS[i]);
                                dwellings.RemoveNpc(dwellings.m_NPCS[i]);
                                index++;
                            }
                        }
                    }
                }
            }
            break;

        case CSConst.etppCoal:
            csc = new CSPPCoal();
            CSPPCoal cscppc = csc as CSPPCoal;
            cscppc.m_Creator   = this;
            cscppc.m_Power     = 10000;
            cscppc.m_RestPower = 10000;
            cscppc.m_Info      = CSInfoMgr.m_ppCoal;
            break;

        case CSConst.etppSolar:
            csc = new CSPPSolar();
            CSPPSolar cspps = csc as CSPPSolar;
            cspps.m_Creator   = this;
            cspps.m_Power     = 10000;
            cspps.m_RestPower = 10000;
            cspps.m_Info      = CSInfoMgr.m_ppCoal;
            break;

        case CSConst.etFarm:
            csc           = new CSFarm();
            csc.m_Creator = this;
            csc.m_Info    = CSInfoMgr.m_FarmInfo;
            break;

        case CSConst.etFactory:
            csc           = new CSFactory();
            csc.m_Creator = this;
            csc.m_Info    = CSInfoMgr.m_FactoryInfo;
            break;

        case CSConst.etProcessing:
            csc = new CSProcessing(this);
            CSProcessing csp = csc as CSProcessing;
            csp.m_Info = CSInfoMgr.m_ProcessingInfo;
            break;

        case CSConst.etTrade:
            csc = new CSTrade(this);
            CSTrade cst = csc as CSTrade;
            cst.m_Info = CSInfoMgr.m_Trade;
            break;

        case CSConst.etTrain:
            csc = new CSTraining(this);
            CSTraining cstrain = csc as CSTraining;
            cstrain.m_Info = CSInfoMgr.m_Train;
            break;

        case CSConst.dtCheck:
            csc = new CSMedicalCheck(this);
            CSMedicalCheck csCheck = csc as CSMedicalCheck;
            csCheck.m_Info = CSInfoMgr.m_Check;
            break;

        case CSConst.dtTreat:
            csc = new CSMedicalTreat(this);
            CSMedicalTreat csTreat = csc as CSMedicalTreat;
            csTreat.m_Info = CSInfoMgr.m_Treat;
            break;

        case CSConst.dtTent:
            csc = new CSMedicalTent(this);
            CSMedicalTent csTent = csc as CSMedicalTent;
            csTent.m_Info = CSInfoMgr.m_Tent;
            break;

        case CSConst.dtppFusion:
            csc = new CSPPFusion();
            CSPPFusion csFusion = csc as CSPPFusion;
            csFusion.m_Creator   = this;
            csFusion.m_Power     = 10000;
            csFusion.m_RestPower = 100000;
            csFusion.m_Info      = CSInfoMgr.m_ppFusion;
            break;

        default:
            break;
        }

        return(csc);
    }
    // Update is called once per frame
    void Update()
    {
        if (m_ItemGrid != null)
        {
            ItemObject item = m_ItemGrid.m_Grid.ItemObj;
            if (item == null)
            {
                m_ItemPart.m_Name.text = "";
                if (m_Type == CSConst.etEnhance)
                {
                    m_EnhanceProperty.m_Durability.text    = "0 ([00BBFF] +0 [ffffff])";
                    m_EnhanceProperty.m_Atk.text           = "0 ([00BBFF] +0 [ffffff])";
                    m_EnhanceProperty.m_Defense.text       = "0 ([00BBFF] +0 [ffffff])";
                    m_EnhanceProperty.m_TimesEnhcance.text = "0";
                }
                else if (m_Type == CSConst.etRepair)
                {
                    m_RepairProperty.m_Durability.text = "0 ([00BBFF] +0 [ffffff])";
                }
                else if (m_Type == CSConst.etRecyle)
                {
                    m_RecycleProperty.m_Durability.text = "0 ([00BBFF] +0 [ffffff])";
                }

                m_ItemPart.m_CostsTime.text = "00:00";

                m_PopupHintsPart.m_EnhanceHintGo.SetActive(false);
                m_PopupHintsPart.m_RepairHintGo.SetActive(false);
                m_PopupHintsPart.m_RecyleHintGo.SetActive(false);
            }
            else
            {
                m_ItemPart.m_Name.text = item.protoData.name;
                // Item property
                float curValue  = 0.0f;
                float nextValue = 0.0f;

                if (m_Type == CSConst.etEnhance)
                {
                    if (m_enhanceItem != null)
                    {
                        curValue  = m_enhanceItem.GetCurLevelProperty(Pathea.AttribType.Atk);
                        nextValue = m_enhanceItem.GetNextLevelProperty(Pathea.AttribType.Atk);
                        m_EnhanceProperty.m_Atk.text = Mathf.FloorToInt(curValue).ToString() + " ([00BBFF] + " + Mathf.FloorToInt((nextValue - curValue)).ToString() + "[ffffff])";

                        curValue  = m_enhanceItem.GetCurLevelProperty(Pathea.AttribType.Def);
                        nextValue = m_enhanceItem.GetNextLevelProperty(Pathea.AttribType.Def);
                        m_EnhanceProperty.m_Defense.text = Mathf.FloorToInt(curValue).ToString() + " ([00BBFF] + " + Mathf.FloorToInt((nextValue - curValue)).ToString() + "[ffffff])";

                        curValue  = m_enhanceItem.GetCurMaxDurability();
                        nextValue = m_enhanceItem.GetNextMaxDurability();

                        WhiteCat.CreationItemClass isoType = WhiteCat.CreationItemClass.None;

                        if (null != m_enhanceItem.itemObj)
                        {
                            isoType = WhiteCat.CreationHelper.GetCreationItemClass(m_enhanceItem.itemObj);
                        }

                        if (isoType != WhiteCat.CreationItemClass.None)
                        {
                            //lz-2017.01.16 只有一部分ISO物品耐久需要乘一个系数才是显示耐久,其他的直接显示原数
                            switch (isoType)
                            {
                            case WhiteCat.CreationItemClass.Sword:
                            case WhiteCat.CreationItemClass.Axe:
                            case WhiteCat.CreationItemClass.Bow:
                            case WhiteCat.CreationItemClass.Shield:
                            case WhiteCat.CreationItemClass.HandGun:
                            case WhiteCat.CreationItemClass.Rifle:
                                curValue  *= WhiteCat.PEVCConfig.equipDurabilityShowScale;
                                nextValue *= WhiteCat.PEVCConfig.equipDurabilityShowScale;
                                break;
                            }
                        }

                        m_EnhanceProperty.m_Durability.text = Mathf.CeilToInt(curValue).ToString() + " ([00BBFF] + " + Mathf.CeilToInt((nextValue - curValue)).ToString() + "[ffffff])";

                        // Times Ehance
                        m_EnhanceProperty.m_TimesEnhcance.text = m_enhanceItem.strengthenTime.ToString();
                    }

                    CSEnhance cse = m_Entity as CSEnhance;
                    m_ItemPart.m_CostsTime.text = CSUtils.GetRealTimeMS((int)cse.CostsTime);

                    m_PopupHintsPart.m_EnhanceHintGo.SetActive(true);
                    m_PopupHintsPart.m_RepairHintGo.SetActive(false);
                    m_PopupHintsPart.m_RecyleHintGo.SetActive(false);
                }
                else if (m_Type == CSConst.etRepair)
                {
                    if (null != m_repairItem)
                    {
                        curValue = m_repairItem.GetValue().current;
                        float expendValue = m_repairItem.GetValue().ExpendValue;
                        WhiteCat.CreationItemClass isoType = WhiteCat.CreationItemClass.None;

                        if (null != m_repairItem.itemObj)
                        {
                            isoType = WhiteCat.CreationHelper.GetCreationItemClass(m_repairItem.itemObj);
                        }

                        if (isoType != WhiteCat.CreationItemClass.None)
                        {
                            //lz-2016.10.25 只有一部分ISO物品耐久需要乘一个系数才是显示耐久,其他的直接显示原数
                            switch (isoType)
                            {
                            case WhiteCat.CreationItemClass.Sword:
                            case WhiteCat.CreationItemClass.Axe:
                            case WhiteCat.CreationItemClass.Bow:
                            case WhiteCat.CreationItemClass.Shield:
                            case WhiteCat.CreationItemClass.HandGun:
                            case WhiteCat.CreationItemClass.Rifle:
                                curValue    *= WhiteCat.PEVCConfig.equipDurabilityShowScale;
                                expendValue *= WhiteCat.PEVCConfig.equipDurabilityShowScale;
                                break;
                            }
                        }
                        else
                        {
                            //lz-2016.10.24 其他物品显示的时候要小于100倍的显示,就和ToolTip上面的防御值一样了
                            curValue    *= 0.01f;
                            expendValue *= 0.01f;
                        }
                        m_RepairProperty.m_Durability.text = Mathf.CeilToInt(curValue).ToString()
                                                             + " ([00BBFF] + " + Mathf.CeilToInt(expendValue).ToString() + "[ffffff])";
                    }

                    CSRepair csr = m_Entity as CSRepair;
                    m_ItemPart.m_CostsTime.text = CSUtils.GetRealTimeMS((int)csr.CostsTime);

                    m_PopupHintsPart.m_EnhanceHintGo.SetActive(false);
                    m_PopupHintsPart.m_RepairHintGo.SetActive(true);
                    m_PopupHintsPart.m_RecyleHintGo.SetActive(false);
                }
                else if (m_Type == CSConst.etRecyle)
                {
                    CSRecycle csr = m_Entity as CSRecycle;
                    m_ItemPart.m_CostsTime.text = CSUtils.GetRealTimeMS((int)csr.CostsTime);

                    if (null != m_recycleItem)
                    {
                        if (m_recycleItem.GetCurrent() == null)
                        {
                            curValue = 0;
                        }
                        else
                        {
                            curValue = m_recycleItem.GetCurrent().current;//todocolony
                        }
                    }

                    WhiteCat.CreationItemClass isoType = WhiteCat.CreationItemClass.None;

                    if (null != m_recycleItem.itemObj)
                    {
                        isoType = WhiteCat.CreationHelper.GetCreationItemClass(m_recycleItem.itemObj);
                    }

                    if (isoType != WhiteCat.CreationItemClass.None)
                    {
                        //lz-2017.01.16 只有一部分ISO物品耐久需要乘一个系数才是显示耐久,其他的直接显示原数
                        switch (isoType)
                        {
                        case WhiteCat.CreationItemClass.Sword:
                        case WhiteCat.CreationItemClass.Axe:
                        case WhiteCat.CreationItemClass.Bow:
                        case WhiteCat.CreationItemClass.Shield:
                        case WhiteCat.CreationItemClass.HandGun:
                        case WhiteCat.CreationItemClass.Rifle:
                            curValue *= WhiteCat.PEVCConfig.equipDurabilityShowScale;
                            break;
                        }
                    }
                    m_RecycleProperty.m_Durability.text = Mathf.CeilToInt(curValue).ToString();

                    m_PopupHintsPart.m_EnhanceHintGo.SetActive(false);
                    m_PopupHintsPart.m_RepairHintGo.SetActive(false);
                    m_PopupHintsPart.m_RecyleHintGo.SetActive(true);
                }
            }
        }

        // Worker
        CSCommon csc = m_Entity as CSCommon;

        if (csc != null)
        {
            int workCount = csc.WorkerCount;
            for (int i = 0; i < m_NpcGirds.Count; i++)
            {
                if (i < workCount)
                {
                    m_NpcGirds[i].m_Npc = csc.Worker(i);
                }
                else
                {
                    m_NpcGirds[i].m_Npc = null;
                }
            }

            m_NpcPart.m_AuttoSettleBtn.isEnabled = (workCount != csc.WorkerMaxCount);

            m_NpcPart.m_DisbandAllBtn.isEnabled = (workCount != 0);
        }
    }