コード例 #1
0
        public void OnClickCreateTroopsInfo()
        {
            m_campItem.SetSelect(true);
            UIWindowTroopsInfo info = UIWindowWrapper.GetWindowAddMask <UIWindowTroopsInfo>();

            info.transform.SetParent(m_troopsAnchor, false);
            info.Open(m_camp);
            IUnitConfItem     unitConfItem     = AW.GetSingleton <IDataAdapter>().GetOwnedUnitConfItem(m_camp.ProduceItem);
            IBuildingConfItem buildingConfItem = AW.GetSingleton <IDataAdapter>().GetBuildingConfItem(m_building);

            m_count = buildingConfItem.GetTroopCostVolume() / unitConfItem.GetCapacityCost();
            Building barrck = (Building)m_camp;

            if (barrck.GetState() == AWEnum.BuildingStateType.Produce)
            {
                info.replace.gameObject.SetActive(false);
                info.SetCompleteButtonStyle(OnClickComplete);
                info.SetCancelButtonStle(OnClickCancel);
                if (m_camp.GetProducedCount() < m_count)
                {
                    info.SetSupplementButtonStyle(OnClickSupplement);
                }
                else
                {
                    info.supplement.gameObject.SetActive(false);
                }
            }
            else
            {
                info.complete.gameObject.SetActive(false);
                info.cancel.gameObject.SetActive(false);
                if (m_camp.GetProducedCount() < m_count)
                {
                    info.SetSupplementButtonStyle(OnClickSupplement);
                    info.SetReplaceButtonStyle(OnClickReplace);
                }
                else
                {
                    info.supplement.gameObject.SetActive(false);
                    info.SetReplaceButtonStyle(OnClickReplace);
                }
            }
            info.SetRename(OnClickRename);
        }