18 lines
279 B
C#
18 lines
279 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class OnCollision : MonoBehaviour
|
|
{
|
|
void OnTriggerEnter2D(Collider2D other)
|
|
{
|
|
if (other.gameObject.name == "Player")
|
|
{
|
|
print("Ow!");
|
|
// player is damaged
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
|