예제 #1
0
파일: ShuView.cs 프로젝트: lifaxiang/MyGame
 public void Show()
 {
     UIPackage.AddPackage("SD/ShuDu");
     UIObjectFactory.SetPackageItemExtension(strItemUrl, typeof(ShuItem));
     GComponent com = UIManager.inst.CreateObject<GComponent>("ShuDu", "GamePanel");
     GRoot.inst.AddChild(com);
     com.SetSize(GRoot.inst.width, GRoot.inst.height);
     com.AddRelation(GRoot.inst, RelationType.Size);
     com.Center();
     GList list = com.GetChild("n1").asList;
     list.RemoveChildrenToPool();
     list.defaultItem = strItemUrl;
     ShuData.inst.InitData();
     for (int i = 0; i < 9; i++)
     {
         for (int j = 0; j < 9 ; j++)
         {
             ShuItem item = list.AddItemFromPool() as ShuItem;
             item.Init(i, j);
         }
     }
     GRoot.inst.DispatchEvent("ShuUpdate");
     list.onClickItem.Add(ItemClick);
     for(int i = 0; i < 10; i++)
     {
         ExchangeRow(Random.Range(0, 9), Random.Range(0, 9));
         ExchangeCol(Random.Range(0, 9), Random.Range(0, 9));
     }
     GRoot.inst.DispatchEvent("ShuHide");
 }
예제 #2
0
파일: ShuView.cs 프로젝트: lifaxiang/MyGame
 private void ItemClick(EventContext context)
 {
     ShuItem com = context.data as ShuItem;
     com.ShowValue();
 }