unity3d - unity C# run method from another class -
I want to run metod in class in second class and both of them arrive at different obj
Two classes. The first is:
Public square Noscore: Monobahavier {Public Zero UpdateSourBuy (Intro) {debug. Logs ("intra + 4" + intra + 4); }} and the other is:
public class newplus: monobahavik {public nouster noucकोर; Public Zero OnTriggerEnter2D (collider2D obj) {newscore.updateScoreBy (+1); }} When I run my code, I do not have an orientation set for an example of "Null ReferenceExtension: Object Reference Object" and it is on newscore.updateScoreBy (+1) Indicates; How can I fix this?
Depending on what you want to do, you can make the function stable:
public static zeros update int intr {debug.log ("intr + 4" + intr + 4); } and call with:
NewScore.updateScoreBy (1);
Comments
Post a Comment