yyl
9 天以前 bb5909bcd36b48b919366c95b4248a3754452698
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections;
using System.Collections.Generic;
 
using UnityEngine;
 
//觉醒
public partial class HeroUIManager : GameSystemManager<HeroUIManager>
{
    public string selectAwakeHeroGuid;
 
    public List<int> heroBeforeAwakeGiftIDList = new List<int>();    //会有重复的ID,不要用字典
    public List<int> heroBeforeAwakeGiftLevelList = new List<int>();
 
 
    //达到X星需要的觉醒等级
    public int GetAwakeLVByStarLV(int heroID, int starLV)
    {
        var config = HeroConfig.Get(heroID);
        var starCnt = HeroQualityConfig.Get(config.Quality).InitStarUpper;
        if (starLV <= starCnt)
            return 0;
 
        Dictionary<int, HeroAwakeConfig> tempDic = null;
        if (!HeroAwakeConfig.configDics.TryGetValue(heroID, out tempDic))
        {
            return 0;
        }
        foreach (var item in tempDic)
        {
            starCnt += item.Value.AddStarUpper;
            if (starCnt >= starLV)
            {
                return item.Key;
            }
        }
        return 0;
    }
 
 
}