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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -