コード例 #1
0
        /// <summary>
        /// 修改玩家动物的等级
        /// </summary>
        /// <param name="id"></param>
        public void SetPlayerAnimalLevelData(int id)
        {
            LittleAnimal_MSS littleAnimal = getPlayerAnimalCell(id);

            littleAnimal.animalLevel += 1;
            playerAllAnimalsLevel    += 1;
        }
コード例 #2
0
        /// <summary>
        /// 获取ID对应的动物数据
        /// </summary>
        /// <param name="key">动物ID</param>
        /// <returns></returns>
        public LittleAnimal_MSS getPlayerAnimalCell(int key)
        {
            LittleAnimal_MSS t = null;
            int idx            = animalID.IndexOf(key.ToString());

            t = this.littleAnimalList[idx];
            return(t);
        }
コード例 #3
0
        /// <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_MSS littleAnimal = new LittleAnimal_MSS
                    {
                        animalLevel    = 0,
                        animalState    = AnimalState.NoneOwn,
                        animalEntityID = 0,
                    };

                    animalID.Add(id);
                    littleAnimalList.Add(littleAnimal);
                }
            }
        }
コード例 #4
0
        /// <summary>
        /// 修改玩家动物为解锁状态
        /// </summary>
        /// <param name="id">动物ID</param>
        public void SetPlayerAnimalDataStayOpen(int id)
        {
            LittleAnimal_MSS littleAnimal = getPlayerAnimalCell(id);

            littleAnimal.animalState = AnimalState.StayOpen;
        }