Exemple #1
0
 private void UpdateHairSet()
 {
     if (_player.HairSetId != _currentSetId)
     {
         _currentSetId   = _player.HairSetId;
         _currentHairSet = FindHairSetById(_currentSetId);
     }
 }
Exemple #2
0
        private bool AlreadyLoaded(HairSet set)
        {
            foreach (var prefab in _hairSetPrefabs)
            {
                if (prefab.Value == set)
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #3
0
        private void DrawCurrentHairSet()
        {
            HairSet set = _currentHairSet;

            if (set != null)
            {
                switch (_player.SpriteOrientation)
                {
                case Direction.Forward:
                    _spriteRenderer.sprite  = set.Back;
                    transform.localPosition = set.BackOffset;
                    break;

                case Direction.Backward:
                    _spriteRenderer.sprite  = set.Front;
                    transform.localPosition = set.FrontOffset;
                    break;

                case Direction.Left:
                    _spriteRenderer.sprite  = set.Left;
                    transform.localPosition = set.LeftOffset;
                    break;

                case Direction.Right:
                    _spriteRenderer.sprite  = set.Right;
                    transform.localPosition = set.RightOffset;
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
            else
            {
                _spriteRenderer.sprite = null;
            }

            _spriteRenderer.color = _defaultHairColor;

            // TODO Getting hair color from Player object
        }