private void OnCharacterSpawned() { var collider = spawnedCharacter .GetCharacter() .GetComponent <Collider2D>(); if (collider != null) { collider.isTrigger = true; } }
private void OnCharacterSpawned() { var components = spawnedCharacter .GetCharacter() .GetComponents <MonoBehaviour>(); foreach (var component in components) { Destroy(component); } }
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 characterDataProvider = GetComponent <ICharacterDataProvider>(); if (characterDataProvider != null) { var characterData = characterDataProvider.GetCharacterData(); var direction = characterData.Direction; var transform = spawnedCharacter.GetCharacter().transform; var x = Mathf.Abs(transform.localScale.x); var y = transform.localScale.y; var z = transform.localScale.z; if (direction == 0) { direction = 1; } transform.localScale = new Vector3(direction, y, z); } }
private void OnCharacterSpawned() { character = spawnedCharacter.GetCharacter().transform; }