/// <summary> /// 修改玩家动物的等级 /// </summary> /// <param name="id"></param> public void SetPlayerAnimalLevelData(int id) { LittleAnimal_MS littleAnimal = getPlayerAnimalCell(id); littleAnimal.animalLevel += 1; playerAllAnimalsLevel += 1; }
/// <summary> /// 获取ID对应的动物数据 /// </summary> /// <param name="key">动物ID</param> /// <returns></returns> public LittleAnimal_MS getPlayerAnimalCell(int key) { LittleAnimal_MS t = null; int idx = animalID.IndexOf(key.ToString()); t = this.littleAnimalList[idx]; return(t); }
/// <summary> /// 初始化玩家的playerAnimalDic /// </summary> public void InitPlayerAnimalDic(int sceneID) { //LogWarp.LogError("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); List <int> LittleZooIDs = new List <int>(); var groupData = Config.groupConfig.getInstace().AllData; foreach (var item in groupData) { if (item.Value.scene == sceneID) { for (int i = 0; i < item.Value.startid.Length; i++) { LittleZooIDs.Add(item.Value.startid[i]); } } } foreach (var item in LittleZooIDs) { var cellBuildupData = Config.buildupConfig.getInstace().getCell(item); for (int i = 0; i < cellBuildupData.animalid.Length; i++) { string id = cellBuildupData.animalid[i].ToString(); LittleAnimal_MS littleAnimal = new LittleAnimal_MS { animalLevel = 0, animalState = AnimalState.NoneOwn, animalEntityID = 0, }; animalID.Add(id); littleAnimalList.Add(littleAnimal); } } }
/// <summary> /// 修改玩家动物为解锁状态 /// </summary> /// <param name="id">动物ID</param> public void SetPlayerAnimalDataStayOpen(int id) { LittleAnimal_MS littleAnimal = getPlayerAnimalCell(id); littleAnimal.animalState = AnimalState.StayOpen; }