31 lines
589 B
C#
31 lines
589 B
C#
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using Unity.VisualScripting;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class fusee : MonoBehaviour
|
||
|
{
|
||
|
public GameObject self;
|
||
|
|
||
|
public float lifetime;
|
||
|
private void OnTriggerEnter(Collider other)
|
||
|
{
|
||
|
if (other.tag != "Player" && other.tag != "Platform" && other.tag != "Finish")
|
||
|
{
|
||
|
Destroy(other.gameObject);
|
||
|
Destroy(self);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private void FixedUpdate()
|
||
|
{
|
||
|
this.lifetime -= 1;
|
||
|
if (this.lifetime < 0)
|
||
|
{
|
||
|
Destroy(self);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|