Hello, I have a problem with displaying the text so I have created a function to call in when a player wins but i want it to display the winning notification as a text. I have tried the UI Text but it gives me NullRefrence error because my method are static and if I made the text static I cant put in the script
Is there a way I can display the winning text with all my functions being static because when i print it the winning message on console works as it displays it.
public static void winner(){
public static Text winText;
if (GameManager.Instance.GameOver) {
if (turn == 1) {
// winText.text = "you win";
print("p1 win");
}
if (turn == 2) {
//winText.text = "you loose";
print ("a1 win");
}
}
}
NullReferenceException: Object reference not set to an instance of an object
ButtonScript.winner () (at Assets/ButtonScript.cs:61)