示例#1
0
        void GetLifePrize(bool bestPrize, PlayerStatusData playerData, int prizeNum)
        {
            resultMsgTxt.text = lifeItem;
            if (bestPrize)
            {
                resultMsgTxt.text = string.Format("+3 {0}", lifeItem);

                for (int i = 0; i < 3; i++)
                {
                    if (playerData.CanIncreaseLifeBuff())
                    {
                        playerData.IncreaseLifeBuff(1);
                    }
                    else
                    {
                        resultMsgTxt.text = string.Format("+3 {0}", stockedLifeMsg);

                        playerData.IncreaseLifeStock(3);
                    }
                }
            }
            else
            {
                if (playerData.CanIncreaseLifeBuff())
                {
                    playerData.IncreaseLifeBuff(1);
                }
                else
                {
                    resultMsgTxt.text = string.Format("+1 {0}", stockedLifeMsg);

                    playerData.IncreaseLifeStock(1);
                }
            }
            resultPanelPrizeImg.sprite = spritesForResult[prizeNum];
        }