Exemplo n.º 1
0
 private void Update()
 {
     if (Vector3.Distance(player.GetPosition(), lastEndPosition) < PLAYER_DISTANCE_SPAWN_LEVEL_PART)
     {
         spawnLevelPart();
     }
 }
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.tag == "Player")
     {
         PlayerPlatformerController pl = other.gameObject.GetComponent(typeof(PlayerPlatformerController)) as PlayerPlatformerController;
         pl.GetHit(1);
         Vector3 knockbackDirection = (pl.GetPosition() - transform.position).normalized;
         pl.DamageKnockback(knockbackDirection, 0.5f);
     }
 }