Sorry for asking a noob question, but I have never used c# in Unity, only unityscript.
Basically I have a public int score
variable stored in Players
Class.
I need to retrieve it in the following method:
void OnTriggerEnter(Collider c)
{
if(c.tag == "PlayerCollision")
{
if(!c.gameObject.transform.parent.gameObject.GetComponent<Player>().isDead)
{
Debug.Log("Hit");
//Load next scene
}
}
}
How can I retrieve the score
variable in this method below and send the variable to the next scene? (In unity script I had to do something like Application.LoadLevel(1);
after of course building the scene as levels. Thanks