mirror of
https://github.com/Steffo99/gravity-fusion.git
synced 2024-11-22 16:24:20 +00:00
25 lines
570 B
C#
25 lines
570 B
C#
|
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);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|