How do namespaces work again?

Testing1.cs

using One.Two.Three.Four;


namespace NEIN
{
    public class Testing1
    {
        Testing2.Something("dope");
    }
}

Testing2.cs

using UnityEngine;

namespace One.Two.Three.Four
{
    public static class Testing2
    {
        public static void Something(string thing)
        {
            Debug.Log(thing);
        }
    }
}

Why can’t I use function Testing2.Something if both class and namespace are static?
Is there a way to interact with other class using syntax above (with minor modifications)?

Edit: If all goes according to plan “Something” won’t be the only function in its namespace.

Why isn’t line 8 of Testing1.cs inside a method? That should produce a syntax error having nothing to do with namespaces, and your code editor should be pointing it out as soon as you typed it.

3 Likes

I think the syntax error is the one he’s seeing, which is probably not expecting the open paren or something.

OP, Joe is correct, stick your calling code in a function and all will be better.

3 Likes