Beispiel #1
0
        private void OnCharacterSpawned()
        {
            var collider = spawnedCharacter
                           .GetCharacter()
                           .GetComponent <Collider2D>();

            if (collider != null)
            {
                collider.isTrigger = true;
            }
        }
Beispiel #2
0
        private void OnCharacterSpawned()
        {
            var components = spawnedCharacter
                             .GetCharacter()
                             .GetComponents <MonoBehaviour>();

            foreach (var component in components)
            {
                Destroy(component);
            }
        }
Beispiel #3
0
        private void OnCharacterSpawned()
        {
            var playerStateAnimator = spawnedCharacter
                                      .GetCharacterSprite()
                                      .AddComponent <PlayerStateAnimator>();

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

                playerController?.SetPlayerStateAnimator(playerStateAnimator);
            }
        }
Beispiel #4
0
        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);
            }
        }
Beispiel #5
0
 private void OnCharacterSpawned()
 {
     character = spawnedCharacter.GetCharacter().transform;
 }