//SCRIPT 1
Class ColorChanger{
Public string currentColor;
}
//SCRIPT 2
Class Player{
private void OnTriggerEnter2D(Collider2D col)
{
If (col.tag != currentColor)
{
Debug.Log("GAME OVER");
}
}
}
If I write SCRIPT 2 part in SCRIPT 1 it will work, but I want to know how to use "currentColor" variable with other scripts?