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

public class TestTest : MonoBehaviour
{
    private Material mat;
    private float destroy;
    private ParticleSystem particleSystem;

    [SerializeField]
    private GameObject particle;

    // Start is called before the first frame update
    void Start()
    {
        mat = GetComponent<SpriteRenderer>().material;
        particleSystem = particle.GetComponent<ParticleSystem>();
        destroy = 0;
    }

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

    void OnFire()
    {
        mat.SetColor("_GlowColor", Color.magenta);
        destroy += 0.1f;
        mat.SetFloat("_Destroy", destroy);
        particleSystem.Play();
    }
}
