2020-09-30 13:23:01 +01:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace Pink.Mechanics
|
|
|
|
|
{
|
|
|
|
|
public class Hot : MonoBehaviour
|
|
|
|
|
{
|
2020-10-01 18:11:43 +01:00
|
|
|
|
public float Damage = 2f;
|
|
|
|
|
|
2020-09-30 13:23:01 +01:00
|
|
|
|
void OnTriggerEnter2D(Collider2D collider)
|
|
|
|
|
{
|
|
|
|
|
var player = collider.gameObject.GetComponent<PinkController>();
|
|
|
|
|
if (player != null)
|
|
|
|
|
{
|
|
|
|
|
Debug.Log("Player Burnt");
|
2020-10-01 18:11:43 +01:00
|
|
|
|
player.health.Hurt(Damage);
|
|
|
|
|
player.controller.Bounce(0.8f);
|
2020-09-30 13:23:01 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-10-01 18:11:43 +01:00
|
|
|
|
}
|