Exemplo n.º 1
0
 private void Awake()
 {
     playerAim               = gameObject.GetComponent <PlayerAim>();
     playerController        = gameObject.GetComponent <PlayerController>();
     playerControllerAndroid = gameObject.GetComponent <PlayerControllerAndroid>();
     playerEffectStatus      = gameObject.GetComponent <PlayerEffectStatus>();
     playerLife              = gameObject.GetComponent <PlayerLife>();
     playerMovement          = gameObject.GetComponent <PlayerMovement>();
 }
Exemplo n.º 2
0
 private void OnCollisionEnter2D(Collision2D other)
 {
     if (other.collider.CompareTag("Player"))
     {
         if (other.transform.GetComponent <Player>() != null)
         {
             PlayerEffectStatus playerData = other.transform.GetComponent <PlayerEffectStatus>();
             if (!playerData.IsCurrentlyStun())
             {
                 playerData.StartCoroutine(playerData.StunPlayer(trapType.stunTime));
             }
             if (trapType.isDamage)
             {
                 other.transform.GetComponent <PlayerLife>().GetDamage();
             }
         }
         transform.position = new Vector2(-7, 0);
     }
 }