示例#1
0
        private void OnCharacterSpawned()
        {
            var spriteRenderer = spawnedCharacter
                                 .GetCharacterSprite()
                                 .GetComponent <SpriteRenderer>();

            if (spriteRenderer != null)
            {
                spriteRenderer.sortingOrder = sortingOrderIndex;
            }
        }
示例#2
0
        private void OnCharacterSpawned()
        {
            var animator = spawnedCharacter
                           .GetCharacterSprite()
                           .GetComponent <Animator>();

            if (animator != null)
            {
                var playerAnimatorProvider =
                    GetComponent <PlayerAnimatorProvider>();

                playerAnimatorProvider?.Initialize(animator);
            }
        }
示例#3
0
        private void OnCharacterSpawned()
        {
            var playerStateAnimator = spawnedCharacter
                                      .GetCharacterSprite()
                                      .AddComponent <PlayerStateAnimator>();

            if (playerStateAnimator != null)
            {
                var playerController = spawnedCharacter
                                       .GetCharacter()
                                       .GetComponent <PlayerController>();

                playerController?.SetPlayerStateAnimator(playerStateAnimator);
            }
        }
示例#4
0
        private void OnCharacterSpawned()
        {
            var characterNameSetter = spawnedCharacter
                                      .GetCharacterSprite()
                                      .GetComponent <CharacterNameSetter>();

            if (characterNameSetter != null)
            {
                var characterDataProvider = GetComponent <ICharacterDataProvider>();
                var characterData         = characterDataProvider.GetCharacterData();
                var name = characterData.Name;

                characterNameSetter.SetName(name);
                characterNameSetter.SetSortingOrder(sortingOrderIndex);
            }
        }