30 lines
566 B
C#
30 lines
566 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Meteor1 : MonoBehaviour
|
|
{
|
|
|
|
public Rigidbody rigidbodyComponent;
|
|
public Vector3 RotationVector;
|
|
|
|
private void FixedUpdate()
|
|
{
|
|
this.transform.Rotate(RotationVector * Time.deltaTime);
|
|
if (this.transform.position.y < -20)
|
|
{
|
|
Destroy(this.gameObject);
|
|
}
|
|
}
|
|
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
if (other.tag == "Player")
|
|
{
|
|
Destroy(other.gameObject);
|
|
}
|
|
}
|
|
|
|
|
|
}
|