2020-07-19 21:36:57 -04:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
public class DarkMatter: MonoBehaviour
|
|
|
|
{
|
2020-09-08 04:10:07 -04:00
|
|
|
private float size;
|
2020-07-19 21:36:57 -04:00
|
|
|
public GameObject collector;
|
|
|
|
|
2020-08-31 04:00:45 -04:00
|
|
|
// Called once per frame by unity engine
|
|
|
|
public void Update()
|
2020-07-19 21:36:57 -04:00
|
|
|
{
|
|
|
|
if (size < 10)
|
|
|
|
{
|
|
|
|
transform.localScale = Vector3.Lerp(transform.localScale, new Vector3(10, 10, 10), Time.deltaTime * 0.5f);
|
|
|
|
size += 1;
|
|
|
|
}
|
|
|
|
else if (size >= 10 && size < 20)
|
|
|
|
{
|
|
|
|
transform.localScale = Vector3.Lerp(transform.localScale, new Vector3(5, 5, 5), Time.deltaTime * 0.5f);
|
|
|
|
size += 1;
|
|
|
|
}
|
|
|
|
else if (size >= 20)
|
|
|
|
{
|
|
|
|
size = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|