Example #1
0
 public void creatrvegrids(int line_num)
 {
     DesObj();
     if (line_num <= 0)
     {
         return;
     }
     for (int i = 0; i < ChangeLineProxy.getInstance().Line_people.Count; i++)
     {
         if (i == PlayerModel.getInstance().line)
         {
             continue;
         }
         GameObject objclone = GameObject.Instantiate(grid) as GameObject;
         objclone.name = (i + 1).ToString();
         objclone.SetActive(true);
         objclone.transform.SetParent(contain.transform, false);
         creatrvegrids_infos(objclone);
         //new BaseButton(objclone.transform).onClick = (GameObject go) =>
         // {
         // onBtnOKClick(go);
         // };
     }
     a3_runestone.commonScroview(getGameObjectByPath("panel/ScrollPanel/content"), ChangeLineProxy.getInstance().Line_people.Count - 1);
 }
Example #2
0
 void onBtnOKClick(GameObject go, int nums)
 {
     if (nums >= 2)
     {
         flytxt.instance.fly(ContMgr.getCont("xianluwenti"));
         return;
     }
     for (int i = 0; i < contain.transform.childCount; i++)
     {
         contain.transform.GetChild(i).gameObject.transform.FindChild("Image").gameObject.SetActive(false);
     }
     go.transform.FindChild("Image").gameObject.SetActive(true);
     ChangeLineProxy.getInstance().select_line(uint.Parse(go.name) - 1);
     //this.gameObject.SetActive(false);
 }
Example #3
0
        void creatrvegrids_infos(GameObject go)
        {
            string sr = "  {0}      {1}       {2}";

            string map_name = string.Empty;

            if (GRMap.curSvrConf != null && GRMap.curSvrConf.ContainsKey("map_name"))
            {
                map_name = GRMap.curSvrConf["map_name"]._str;
            }

            string lingtype   = string.Empty;
            uint   people_num = ChangeLineProxy.getInstance().Line_people[int.Parse(go.name) - 1];
            int    num1       = XMLMgr.instance.GetSXML("comm.fx_state_3").getInt("val");
            int    num2       = XMLMgr.instance.GetSXML("comm.fx_state_2").getInt("val");
            int    num3       = XMLMgr.instance.GetSXML("comm.fx_state_1").getInt("val");
            int    numx       = 0;

            if (people_num >= 0 && people_num < num1)
            {
                numx     = 0;
                lingtype = XMLMgr.instance.GetSXML("comm.fx_state_3").getString("c");
            }
            else if (people_num >= num1 && people_num < num2)
            {
                numx     = 1;
                lingtype = XMLMgr.instance.GetSXML("comm.fx_state_2").getString("c");
            }
            else
            {
                numx     = 2;
                lingtype = XMLMgr.instance.GetSXML("comm.fx_state_1").getString("c");
            }
            Text txt = go.transform.FindChild("Label").GetComponent <Text>();

            txt.text = string.Format(sr, ContMgr.getCont("a3_mapChangeLine11") + go.name, map_name, lingtype);
            new BaseButton(go.transform).onClick = (GameObject gos) =>
            {
                onBtnOKClick(gos, numx);
            };
        }
Example #4
0
 public override void onShowed()
 {
     ChangeLineProxy.getInstance().sendLineProxy();
 }