1
Fork 0
mirror of https://github.com/Steffo99/gravity-fusion.git synced 2024-11-22 16:24:20 +00:00
gravity-fusion/Assets/Components/Emit.cs

25 lines
570 B
C#
Raw Normal View History

2019-10-05 21:50:43 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Particle))]
public class Emitter : MonoBehaviour
{
public GameObject particlePrefab;
protected Particle particle;
protected void Awake() {
particle = GetComponent<Particle>();
}
protected void Start() {
InvokeRepeating("Emit", 1f, 1f);
}
protected void Emit() {
for(int i = 0; i < particle.Tier - 1; i++) {
Instantiate(particlePrefab, transform.position, Quaternion.identity);
}
}
}