private void OnCharacterSpawned() { var spriteRenderer = spawnedCharacter .GetCharacterSprite() .GetComponent <SpriteRenderer>(); if (spriteRenderer != null) { spriteRenderer.sortingOrder = sortingOrderIndex; } }
private void OnCharacterSpawned() { var animator = spawnedCharacter .GetCharacterSprite() .GetComponent <Animator>(); if (animator != null) { var playerAnimatorProvider = GetComponent <PlayerAnimatorProvider>(); playerAnimatorProvider?.Initialize(animator); } }
private void OnCharacterSpawned() { var playerStateAnimator = spawnedCharacter .GetCharacterSprite() .AddComponent <PlayerStateAnimator>(); if (playerStateAnimator != null) { var playerController = spawnedCharacter .GetCharacter() .GetComponent <PlayerController>(); playerController?.SetPlayerStateAnimator(playerStateAnimator); } }
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); } }