Quantcast
Channel: Questions in topic: "namespace"
Viewing all articles
Browse latest Browse all 398

How do you use namespace functions?

$
0
0
I have a weird problem that no one seems to be talking about. I'm trying to use namespaces for my script mainly to see how it works but no matter how simple the function is it gives me a nullreferenceexception. heres a example namespace namespaceExample { public class TestClass : MonoBehaviour { public void TestFunction(string message) { print(message); } } } class TestClass2 { public string message = "Hello World!"; namespaceExample.TestClass test; void Test() { test.TestFunction(message); } } can someone explain to my why this happens? I'm using unity 2017.2.0f3

Viewing all articles
Browse latest Browse all 398

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>