using System; using UnityEngine; using static UnityEngine.EventSystems.EventTrigger; public class Meteorite : MonoBehaviour { private Rigidbody rigidbodyComponent; private UIManager UIManager; void Start() { UIManager = FindAnyObjectByType(); rigidbodyComponent = GetComponent(); //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); } } }