unity-abgabe2/Assets/Projectile.cs
2021-04-25 16:20:23 +02:00

20 lines
390 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Projectile : MonoBehaviour
{
void Start()
{
}
public void OnCollisionEnter(Collision collision){
var bot = collision.collider?.transform.root.GetComponent<Bot>();
if(bot != null){
bot.hit();
}
Destroy(this.gameObject);
}
}