Ejemplo n.º 1
0
        private void GetRandomLoot() //TODO test one
        {
            var size = Random.Range(1, 5);

            for (int i = 0; i < size; i++)
            {
                var parts = modelController.GetAllParts();
                var index = Random.Range(0, parts.Length);
                var count = Random.Range(1, 6);

                var part = parts[index];
                var loot = new PartData
                {
                    Id    = part.Id,
                    Name  = part.Name,
                    Image = part.Image,
                    Count = count
                };
                gameStateController.AddLoot(loot);
            }
        }