2020-07-11 01:42:26 -04:00
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class ObsctaleScript : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
private float deathTime;
|
|
|
|
|
private float myTime = 0.0f;
|
|
|
|
|
|
|
|
|
|
void Start()
|
|
|
|
|
{
|
|
|
|
|
|
2020-07-11 18:46:10 -04:00
|
|
|
deathTime = Random.Range(10.0f, 15.0f);
|
2020-07-11 01:42:26 -04:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
|
void Update()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
myTime += Time.deltaTime;
|
|
|
|
|
|
|
|
|
|
if(myTime > deathTime)
|
|
|
|
|
{
|
|
|
|
|
Destroy(gameObject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|