using UnityEngine;
using System.Collections;

public class PlanetInstantiatorScript : MonoBehaviour {

	public GameObject planetIn;
	public GameObject planetOut;

	public StageManagerScript manager;
	public static PlanetInstantiatorScript instance;

	// Use this for initialization
	void Start () {
		instance = this;
	}
	
	// Update is called once per frame
	void Update () {
		
	}

	public void CreatePlanetIn(Vector3 position){
		if (manager.absorbPlanetCount > 0) {
			Instantiate (planetIn, position, Quaternion.identity);
			manager.absorbPlanetCount--;
			manager.UpdateLabels ();
		}
	}

	public void CreatePlanetOut(Vector3 position){
		if (manager.expelPlanetCount > 0) {
			Instantiate (planetOut, position, Quaternion.identity);
			manager.expelPlanetCount--;
			manager.UpdateLabels ();
		}
	}
}
