Beispiel #1
0
        public void AddPlayerPreviews(int slotIndex)
        {
            int i = 0;

            foreach (
                CharacterAsset res
                in CharacterLibrary.Instance.Characters)
            {
                if (res == null)
                {
                    continue;
                }

                CharacterPreview preview =
                    _previewTemplate.Create(
                        transform,
                        (slotIndex * CharacterLibrary.Instance.Characters.Length) + i);

                _characterPlayerPreviews.Add(
                    Utils.MakePair(slotIndex, res.Id),
                    preview);

                i++;
            }
        }
Beispiel #2
0
 public bool GetCharacterPreview(
     int playerId,
     int characterId,
     out CharacterPreview preview)
 {
     return
         (_characterPlayerPreviews
          .TryGetValue(
              Utils.MakePair(playerId, characterId),
              out preview));
 }
        public CharacterPreview Create(
            Transform transform,
            int index)
        {
            int characterIndex = index % CharacterLibrary.Instance.Characters.Length;

            CharacterPreview preview = this.Create(transform);

            preview.gameObject.SetActive(true);
            preview.Init(
                CharacterLibrary.Instance.Characters[characterIndex],
                UILibrary.Instance.CharacterRenderTextures[index],
                index * DistanceBetween
                );

            return(preview);
        }