Example #1
0
        public int Random_DiceSlotsReward(out bool isGold)
        {
            int rewardRangeIndex = Get_Config_DiceRewardRangeIndex();
            MG_Dice_JackpotConfig _Dice_JackpotConfig = MG_Config.MG_Dice_JackpotConfigs[rewardRangeIndex];
            float result = UnityEngine.Random.Range(0, _Dice_JackpotConfig.noRewardRate + _Dice_JackpotConfig.goldRewardRate + _Dice_JackpotConfig.cashRewardRate);

            if (result < _Dice_JackpotConfig.noRewardRate)
            {
                isGold = true;
                return(0);
            }
            else if (result < _Dice_JackpotConfig.noRewardRate + _Dice_JackpotConfig.goldRewardRate)
            {
                isGold = true;
                MG_PopDiceReward_Type    = MG_PopRewardPanel_RewardType.Gold;
                MG_PopDiceReward_Num     = _Dice_JackpotConfig.goldPool[UnityEngine.Random.Range(0, _Dice_JackpotConfig.goldPool.Count)];
                MG_PopDiceReward_Mutiple = _Dice_JackpotConfig.mutiplePool[UnityEngine.Random.Range(0, _Dice_JackpotConfig.mutiplePool.Count)];
                return(MG_PopDiceReward_Num);
            }
            else
            {
                isGold = false;
                MG_PopDiceReward_Type    = MG_PopRewardPanel_RewardType.Cash;
                MG_PopDiceReward_Num     = _Dice_JackpotConfig.cashPool[UnityEngine.Random.Range(0, _Dice_JackpotConfig.cashPool.Count)];
                MG_PopDiceReward_Mutiple = _Dice_JackpotConfig.mutiplePool[UnityEngine.Random.Range(0, _Dice_JackpotConfig.mutiplePool.Count)];
                return(MG_PopDiceReward_Num);
            }
        }
Example #2
0
        public int Random_DiceSlotsReward(out bool isGold, out float mutiple)
        {
            int rewardRangeIndex = Get_Config_DiceRewardRangeIndex();
            MG_Dice_JackpotConfig _Dice_JackpotConfig = MG_Config.MG_Dice_JackpotConfigs[rewardRangeIndex];
            float result = UnityEngine.Random.Range(0, _Dice_JackpotConfig.noRewardRate + _Dice_JackpotConfig.goldRewardRate + _Dice_JackpotConfig.cashRewardRate);

            if (result < _Dice_JackpotConfig.noRewardRate)
            {
                isGold  = true;
                mutiple = 0;
                return(0);
            }
            else if (result < _Dice_JackpotConfig.noRewardRate + _Dice_JackpotConfig.goldRewardRate)
            {
                isGold = true;
                int rewardGoldNum = _Dice_JackpotConfig.goldPool[UnityEngine.Random.Range(0, _Dice_JackpotConfig.goldPool.Count)];
                mutiple = _Dice_JackpotConfig.mutiplePool[UnityEngine.Random.Range(0, _Dice_JackpotConfig.mutiplePool.Count)];
                return(rewardGoldNum);
            }
            else
            {
                isGold = false;
                int rewardCashNum = _Dice_JackpotConfig.cashPool[UnityEngine.Random.Range(0, _Dice_JackpotConfig.cashPool.Count)];
                mutiple = _Dice_JackpotConfig.mutiplePool[UnityEngine.Random.Range(0, _Dice_JackpotConfig.mutiplePool.Count)];
                return(rewardCashNum);
            }
        }