Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        itemList = transform.Find("ItemList").Find("Grid").gameObject;
        ItemInfo = transform.Find("ItemInfoPanel").gameObject;
        transform.Find("TitleText").GetComponent <Text>().text = LanController.getString("shop").ToUpper();
        listItemRender = transform.Find("ItemList").Find("ShopItemRender").gameObject;

        treasureDic   = SpecController.getGroup(TreasureTab);
        bulletDic     = SpecController.getGroup(BulletTab);
        bulletItemDic = SpecController.getGroup(BulletItemTab);
        cannonDic     = SpecController.getGroup(CannonTab);

        showItemList();
    }
Esempio n. 2
0
    //添加宠物
    public void addPet(string id)
    {
        Dictionary <string, ItemSpec> dic = SpecController.getGroup("Fish");

        string[] dicNames = new string[dic.Count];
        dic.Keys.CopyTo(dicNames, 0);

        PetData petData = new PetData();

        petData.initId(PlayerData.creatPetId(), id);
        petData.curHeart = 2000;
        PlayerData.addPet(petData);
        LoginController.GetInstance().creatNewPet(petData);
    }
    Dictionary <string, ItemSpec> getFishTypes(string landName)
    {
        Dictionary <string, ItemSpec> fishes = SpecController.getGroup("Fish");

        Dictionary <string, ItemSpec> newFishes = new Dictionary <string, ItemSpec> ();

        foreach (string key in fishes.Keys)
        {
            FishItemSpec spec = fishes[key] as FishItemSpec;
            if (spec.common == 1 || spec.common == 2 || spec.common == 3)
            {
                newFishes.Add(key, spec);
            }
        }

        return(newFishes);
    }
Esempio n. 4
0
 private static Dictionary <int, List <FishItemSpec> > getFishDic()
 {
     if (fishDic == null)
     {
         fishDic = new Dictionary <int, List <FishItemSpec> > ();
         Dictionary <string, ItemSpec> dic = SpecController.getGroup("Fish");
         foreach (ItemSpec spec in dic.Values)
         {
             int com = (spec as FishItemSpec).common;
             if (fishDic.ContainsKey(com))
             {
                 fishDic [com].Add(spec as FishItemSpec);
             }
             else
             {
                 fishDic.Add(com, new List <FishItemSpec> ()
                 {
                     spec as FishItemSpec
                 });
             }
         }
     }
     return(fishDic);
 }