Example #1
0
        private void SetPortrait(Dictionary <Portrait.Slot, string> portraitKeys, Portrait portrait)
        {
            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);
            }

            portrait.SetPortrait(sprites);
        }
Example #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);
        }