using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DeathParticle : MonoBehaviour, IPooledObject{

    public Color level1Color;
    public Color level2Color;
    public Color level3Color;

    GameController gameController;

    // Start is called before the first frame update
    public void OnObjectSpawn(){
        gameController = FindObjectOfType<GameController>();
        if (gameController.level == 1 || gameController.level == 0){
            ParticleSystem ps = GetComponent<ParticleSystem>();
            var main = ps.main;
            main.startColor = level1Color;
        }
        if (gameController.level == 2){
            ParticleSystem ps = GetComponent<ParticleSystem>();
            var main = ps.main;
            main.startColor = level2Color;
        }
        if (gameController.level == 3){
            ParticleSystem ps = GetComponent<ParticleSystem>();
            var main = ps.main;
            main.startColor = level3Color;
        }
    }

    // Update is called once per frame
    void Update(){
        
    }
}
