Exemplo n.º 1
0
        private void SetPortrait(Dictionary <Portrait.Slot, string> portraitKeys)
        {
            var sprites = new Dictionary <Portrait.Slot, Sprite>();

            var spriteStore = FindObjectOfType <SpriteStore>();

            foreach (var slot in portraitKeys.Keys)
            {
                var slotSprite = spriteStore.GetPortraitSpriteForSlotByKey(slot, portraitKeys[slot]);
                sprites.Add(slot, slotSprite);
            }

            cPortrait.SetPortrait(sprites);
        }
Exemplo n.º 2
0
        private void SetPortrait(Dictionary <Portrait.Slot, string> portraitKeys)
        {
            var sprites = new Dictionary <Portrait.Slot, Sprite>();

            var spriteStore = FindObjectOfType <SpriteStore>();

            foreach (var slot in portraitKeys.Keys)
            {
                var slotSprite = spriteStore.GetPortraitSpriteForSlotByKey(slot, portraitKeys[slot]);
                sprites.Add(slot, slotSprite);
            }

            if (_portrait == null)
            {
                _portrait = _portraitParent.GetComponent <Portrait>();
            }

            _portrait.SetPortrait(sprites);
        }