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
↧