Esempio n. 1
0
        private void OnClickRename()
        {
            Debug.Log("OnClickRename");
            UIWindowEnterName name = UIWindowWrapper.GetWindowAddMask <UIWindowEnterName>();

            name.Open();
            name.SetStyle(OnNameVerify);
        }
Esempio n. 2
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);
        }
Esempio n. 3
0
 private void RenameCallBack(bool result)
 {
     UIWindowWrapper.GetWindowAddMask <UIWindowEnterName>().Close();
     m_campItem.SetUnitName();
 }
Esempio n. 4
0
 private void CallBack(bool result)
 {
     m_troopsAnchor.GetComponentInChildren <UIWindowTroopsInfo>().Close();
     UIWindowWrapper.GetWindowAddMask <UIWindowUnitProduce>().InitProduce();
 }