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

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

            foreach (var component in components)
            {
                Destroy(component);
            }
        }
예제 #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 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);
            }
        }
예제 #5
0
 private void OnCharacterSpawned()
 {
     character = spawnedCharacter.GetCharacter().transform;
 }