public int GetBonus(EixoNome eixo)
        {
            int bns = _slots.Where(field => field.Status == MochilaSlotStatus.full)
                      .Select((item) => item.ItemMochila)
                      .Where((item) => item.eixo == eixo)
                      .Select((x) => x.bonus).Sum();

            return(bns);
        }
示例#2
0
        public static Sprite LoadImageFile(String filename, ItemTipo tipo, EixoNome eixo)
        {
            Sprite sprite = null;

            try
            {
                string eixoString = Enum.GetName(typeof(EixoNome), eixo);
                string tipoString = Enum.GetName(typeof(ItemTipo), tipo);
                if (filename == null)
                {
                    filename = "_";
                }
                var filePath = Path.Combine("Sprites", tipoString, eixoString, filename);
                Debug.Log(filePath);
                sprite = Resources.Load <Sprite>(filePath);
            }catch (Exception e)
            {
                Debug.LogWarning(e);
            }
            return(sprite);
        }