using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemyAge : MonoBehaviour
{
public float EfreshAge;
public GameObject epaint;
public GameObject Circle;
public GameObject Player;
public float freshAge;
public PlayerAge FreshAge;
private bool isOnEPaint;
private bool isOnCircle;
private void FixedUpdate()
{
if (isOnEPaint == false)
{
EfreshAge += Time.deltaTime;
}
else
{
EfreshAge = 0f;
Debug.Log("EFRESH");
}
isOnEPaint = false;
if (isOnCircle == true)
{
Debug.Log("OOB");
if (EfreshAge > freshAge)
{
Debug.Log("ENOTFRESH");
Instantiate(epaint, transform.position, transform.rotation);
Destroy(gameObject, 0);
}
}
}
public void OnTriggerStay2D(Collider2D collision)
{
isOnEPaint = collision.gameObject.name == ("Epaint");
isOnEPaint = collision.gameObject.name == ("Epaint (clone)");
isOnCircle = collision.gameObject.name == ("Player");
}
}