using UnityEngine;
using System.Collections;

public class ArenaScript : MonoBehaviour {

	public GUISkin mySkin;

	static int player1Score = 0;
	static int player2Score = 0;

	// Use this for initialization
	void Start () {
		GameObject.DontDestroyOnLoad(this);

		ArenaScript[] splashes = GameObject.FindObjectsOfType<ArenaScript>();
		if(splashes.Length > 1){
			for(int i = 1; i < splashes.Length; i++)
			{
				GameObject.Destroy(splashes[i].gameObject);
			}
		}

	}

	public static void registerDeath(int player){
		if(player == 0){player2Score++;}
		if(player == 1){player1Score++;}
	}

	public void OnGUI(){
		if(GameObject.FindObjectOfType<SplashScreen>().currentLevel == 3)
		{
			GUI.Label(new Rect(10,10,100,100),player1Score.ToString(),mySkin.label);
			GUI.Label(new Rect(Screen.width-20,Screen.height-50,100,100),player2Score.ToString(),mySkin.label);
		}
	}
}
