test
This commit is contained in:
25
My project/Assets/Script/Meteorite.cs
Normal file
25
My project/Assets/Script/Meteorite.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user