using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

public class GameBounds : Singleton<GameBounds>
{
    public float leftEdge
    {
        get
        {
            return transform.position.x - bounds.extents.x;
        }
    }
    public float rightEdge
    {
        get
        {
            return transform.position.x + bounds.extents.x;
        }
    }
    public float topEdge
    {
        get
        {
            return transform.position.y + bounds.extents.y;
        }
    }
    public float bottomEdge
    {
        get
        {
            return transform.position.y - bounds.extents.y;
        }
    }

    private Bounds bounds;

    public override void Awake()
    {
        base.Awake();
        Collider col = gameObject.GetComponent<Collider>();
        bounds = col.bounds;
        Collider.Destroy(col);
    }
}
