20 lines
390 B
C#
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);
|
||
|
}
|
||
|
}
|