Esempio n. 1
0
        public void OnWorldTreeDungeonInfosUpdate(int lastPassDungeon, int fruitPurchasedTimes, int failedTimes)
        {
            _worldTreeFruitPurchasedTimes = fruitPurchasedTimes;
            _faildTimes = failedTimes;
            List <WorldTreeDungeonInfo> allWorldTreeDungeonInfoList = GetAllWorldTreeDungeonInfoList();
            int allWorldTreeDungeonInfoCount          = allWorldTreeDungeonInfoList.Count;
            int lastPassDungeonIndex                  = GetWorldTreeDungeonIndexByID(lastPassDungeon);
            WorldTreeDungeonInfo worldTreeDungeonInfo = null;

            for (int i = 0; i < allWorldTreeDungeonInfoCount; i++)
            {
                worldTreeDungeonInfo = allWorldTreeDungeonInfoList[i];
                if (i <= lastPassDungeonIndex)
                {
                    worldTreeDungeonInfo.worldTreeDungeonStatus = WorldTreeDungeonStatus.Passed;
                }
                else if (i == lastPassDungeonIndex + 1)
                {
                    worldTreeDungeonInfo.worldTreeDungeonStatus = WorldTreeDungeonStatus.Unlocked;
                    _unlockedWorldTreeDungeonInfo = worldTreeDungeonInfo;
                }
                else
                {
                    worldTreeDungeonInfo.worldTreeDungeonStatus = WorldTreeDungeonStatus.Locked;
                }
            }

            if (onWorldTreeDungeonInfosUpdateDelegate != null)
            {
                onWorldTreeDungeonInfosUpdateDelegate();
            }
        }
Esempio n. 2
0
        public WorldTreeDungeonInfo GetWorldTreeInfoByID(int id)
        {
            WorldTreeDungeonInfo worldTreeDungeonInfo = null;

            WorldTreeDungeonInfoDictionary.TryGetValue(id, out worldTreeDungeonInfo);
            return(worldTreeDungeonInfo);
        }
Esempio n. 3
0
        public WorldTreeDungeonInfo GetNextWorldTreeDungeonInfo(int currentWorldTreeDungeonID)
        {
            WorldTreeDungeonInfo        nextWorldTreeDungeonInfo    = null;
            List <WorldTreeDungeonInfo> allWorldTreeDungeonInfoList = GetAllWorldTreeDungeonInfoList();

            for (int i = 0, count = allWorldTreeDungeonInfoList.Count; i < count - 1; i++)
            {
                if (allWorldTreeDungeonInfoList[i].dungeonID == currentWorldTreeDungeonID)
                {
                    nextWorldTreeDungeonInfo = allWorldTreeDungeonInfoList[i + 1];
                }
            }
            return(nextWorldTreeDungeonInfo);
        }