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

public class PlanetManager : MonoBehaviour
{
    public E_PlanetType planetType;
    public GameObject planetAsset;
    public SphereCollider planetCollider;

    

    public void GetResource()
    {
        switch(planetType)
        {
            case E_PlanetType.Energy:

                PlayerStatsManager.Instance.ModifyEnergy(15);

                break;

            case E_PlanetType.Oxigen:

                PlayerStatsManager.Instance.ModifyOxigen(15);

                break;
        }

        planetAsset.SetActive(false);
        planetCollider.enabled = false;

        Timing.RunCoroutine(C_RespawnResources());
    }

    private IEnumerator<float> C_RespawnResources()
    {
        yield return Timing.WaitForSeconds(5f);
        planetAsset.SetActive(true);
        planetCollider.enabled = true;

        yield break;
    }

   
}
