25 lines
689 B
C#
25 lines
689 B
C#
using System;
|
|
using UnityEngine;
|
|
using static UnityEngine.EventSystems.EventTrigger;
|
|
|
|
public class Meteorite : MonoBehaviour
|
|
{
|
|
private Rigidbody rigidbodyComponent;
|
|
private UIManager UIManager;
|
|
void Start()
|
|
{
|
|
UIManager = FindAnyObjectByType<UIManager>();
|
|
rigidbodyComponent = GetComponent<Rigidbody>();
|
|
//rigidbodyComponent.linearVelocity = new Vector3(0.7f, -0.4f, 0);
|
|
}
|
|
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
if (other.gameObject.layer != 9)
|
|
{
|
|
if (other.gameObject.tag == "droid")
|
|
StartCoroutine(UIManager.GameOverSequence());
|
|
Destroy(other.gameObject);
|
|
}
|
|
}
|
|
} |