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

public class FireHandler : MonoBehaviour{
    public List<GameObject> particles;

    Interactables interactables;

    void Start() {
        interactables = GetComponent<Interactables>();
        reaction();
    }

    public void repair(){
        foreach(var p in particles){
            p.SetActive(true);
        }
    }

    public void reaction(){
        foreach(var p in particles){
            p.SetActive(false);
        }
    }

    void OnTriggerStay(Collider other) {
        if(interactables.getState() == InteractablesState.Enabled){
            PlayerController pc = other.GetComponent<PlayerController>();
            if(pc != null){
                pc.takeDamage(3);
            }
        }
    }
}
