Ejemplo n.º 1
0
        public void OnButton02Call()
        {
            lc_ObjViewer objviewer = MainMapScene.Instance.objviewer;
            int          pop = 0, ems = 0;


            lc_Country[] countrys = objviewer.viewAllObject <lc_Country>();
            Debug.Log("length=[" + countrys.Length + "]");
            for (int i = 0; i < countrys.Length; i++)
            {
                pop = 0; ems = 0;
                List <uint> citys = objviewer.ViewCountryCity(countrys[i].obj_id);
                Debug.Log("country[" + countrys[i].m_name + "] have [" + citys.Count + "] citys");
                for (int j = 0; j < citys.Count; j++)
                {
                    lc_City      city    = objviewer.ViewObject <lc_City>(citys[j]);
                    STU_CITY_INF citystu = objviewer.viewRelShep <STU_CITY_INF>(city.obj_id);
                    pop += citystu.city_peonum;
                    ems += city.m_ems;
                    Debug.Log("city[" + city.m_name + "] pop=" + city.m_pop);
                }
                Debug.Log("country[" + countrys[i].m_name + "] pop=[" + pop + "]");
                countrys[i].m_pop = pop;
                countrys[i].m_ems = ems;
            }

            if (countrys != null)
            {
                Singleton <ContextManager> .Instance.Push(new CountryPanelContext(countrys));
            }
        }
Ejemplo n.º 2
0
        private void OnMouseIn(NotifyEvent evt)
        {
            //Debug.Log("Mouse IN");
            string strobjid;
            uint   obj_id = 0;

            this.gameObject.SetActive(true);
            evt.Params.TryGetValue("OBJID", out strobjid);
            obj_id = (uint)int.Parse(strobjid);
            lc_City      city     = objmanager.GetObject <lc_City>(obj_id);
            STU_CITY_INF city_inf = objmanager.GetRelShip <STU_CITY_INF>(obj_id);

            city.m_pop = city_inf.city_peonum;
            ShowData(city);
        }