1
0
Fork 0
Bildschirmflausch-LD41/Assets/Scripts/Entities/Player.cs

33 lines
593 B
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : Mob {
public Player() : base(null, 100 )
{
2018-04-21 19:50:12 +02:00
}
2018-04-21 20:13:58 +02:00
private void OnCollisionEnter2D(Collision2D collision)
2018-04-21 19:50:12 +02:00
{
Debug.Log("Collision");
if (collision.collider.tag == "wall") {
Kill();
}
}
2018-04-21 20:13:58 +02:00
private void OnTriggerEnter2D(Collider2D other)
2018-04-21 19:50:12 +02:00
{
if (other.tag == "door") {
Debug.Log("Open door");
}
}
public override void Kill()
{
base.Kill();
Destroy(this.gameObject);
}
}