Ejemplo n.º 1
0
    protected override void Init()
    {
        instance     = this;
        expBar.state = ProgressState.STRING;
        if (FSDataNodeTable <PlayerLevelUpNode> .GetSingleton().DataNodeList.ContainsKey(playerData.GetInstance().selfData.level))
        {
            expBar.InValue(int.Parse(playerData.GetInstance().selfData.exprience.ToString()), FSDataNodeTable <PlayerLevelUpNode> .GetSingleton().DataNodeList[playerData.GetInstance().selfData.level].exp);
        }

        expBar.onChange = OnExpChange;
    }
Ejemplo n.º 2
0
    void RefreshBox(MapNode map)
    {
        int boxID = types + map.MapId;

        if (!GameLibrary.mapBox.ContainsKey(boxID))
        {
            return;
        }
        int[][] box = new int[GameLibrary.mapBox[boxID].Length][];
        for (int i = 0; i < box.Length; i++)
        {
            box[i] = new int[GameLibrary.mapBox[boxID][i].Length];
            for (int j = 0; j < box[i].Length; j++)
            {
                box[i][j] = GameLibrary.mapBox[boxID][i][j];
            }
        }

        int starCount    = (types == 1 ? map.ordinary.Length : map.elite.Length) * 3;
        int barStarCount = totalStar - box[0][0] < 0 ? 0 : totalStar - box[0][0];

        PbStarsGotLabel.text = "[2dd740]" + totalStar + "[-]/" + starCount;
        PbStarsGot.InValue(barStarCount, starCount - box[0][0]);

        for (int i = 0; i < RewardButtons.Length; i++)
        {
            RewardButtons[i].boxIndex          = i == 0 ? i + 1 : i + 2;
            RewardButtons[i].Sprite.spriteName = "baox" + RewardButtons[i].boxIndex + "_close";
            RewardButtons[i].Label.text        = "" + box[i][0];
            RewardButtons[i].info         = box[i];
            RewardButtons[i].index        = i;
            RewardButtons[i].OnPressClick = null;
            if (null == RewardButtons[i].boxEffect)
            {
                RewardButtons[i].boxEffect = RefreshBoxEffect(RewardButtons[i].Sprite.gameObject);
            }
            RewardButtons[i].SetEffectActive(false);
            if (box[i][5] == 0 && RewardButtons[i].Sprite.spriteName != "baox" + RewardButtons[i].boxIndex + "_open")
            {
                RewardButtons[i].OnPressClick += OnBoxPress;
                if (!rewards.ContainsKey(RewardButtons[i].gameObject))
                {
                    rewards.Add(RewardButtons[i].gameObject, RewardButtons[i]);
                }
                if (totalStar >= box[i][0])
                {
                    RewardButtons[i].SetEffectActive(true);
                }
            }
            else
            {
                RewardButtons[i].Sprite.spriteName = "baox" + RewardButtons[i].boxIndex + "_open";
            }
        }
    }