Пример #1
0
        private void GiveLootToPlayer(float amountFactor)
        {
            int randomItemIndex = ProbabilityUtils.RandomChoiceFollowingDistribution(GetLootProbabilities());
            var randomItem      = m_Loot[randomItemIndex];

            int added;

            randomItem.AddToInventory(out added, amountFactor);
            string colorToHex = ColorUtils.ColorToHex(m_LootNameColor);

            if (m_ShowGatherMessage && added > 0)
            {
                MessageDisplayer.Instance.PushMessage(
                    string.Format("Gathered <color={0}>{1}</color> x {2}", colorToHex, randomItem.ItemName, added), m_MessageColor);
            }

            //print("Added loot with index: " + randomItemIndex);
        }
Пример #2
0
        public DetailSpawn GetRockPrefab()
        {
            int choice = ProbabilityUtils.RandomChoiceFollowingDistribution(GetSpawnProbabilities(m_RockList));

            return(m_RockList[choice]);
        }