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

public class BoiloverController : MonoBehaviour
{

    private OilSpread spread;
    private GameObject FireBottom;
    void Start()
    {
        spread = GetComponentInChildren<OilSpread>();
        FireBottom = transform.Find("FireBottom").gameObject;
        spread.oilSpred = true;
    }

    // Update is called once per frame
    void Update()
    {
        if (spread.transform.localScale.x >= spread.scale - 0.1f)
        {
            if (!FireBottom.gameObject.activeSelf)
                FireBottom.gameObject.SetActive(true);
            if (GetComponent<FireFlowControl>())
            {
                GetComponent<FireFlowControl>().CatchFire = true;
            }
        }
    }
}