33 lines
670 B
C#
33 lines
670 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Player : Mob {
|
|
|
|
public Player() : base(null, 100 )
|
|
{
|
|
|
|
}
|
|
|
|
private void OnCollisionEnter2D(Collision2D collision)
|
|
{
|
|
Debug.Log("Collision");
|
|
if (collision.collider.tag == "wall") {
|
|
Kill();
|
|
}
|
|
}
|
|
|
|
private void OnTriggerEnter2D(Collider2D other)
|
|
{
|
|
if (other.tag == "door") {
|
|
Debug.Log("Open door");
|
|
}
|
|
}
|
|
|
|
public override void Kill()
|
|
{
|
|
base.Kill();
|
|
Destroy(this.gameObject);
|
|
GameController.instance.ChangeState(GameController.GameState.ENDED);
|
|
}
|
|
}
|