1. Hello again,
    Maybe I'm just stupid, but I don't know why I'm getting error while calling GameManager method or just while trying to get value of variable.

    Code:
    TypeError Object has no method 'GetPlayerCount':
    Code:

    Code:
    var global = importNamespace("");var UnityEngine = importNamespace("UnityEngine");var plugin = {
        Init: function() {
            command.AddChatCommand('test', this.Plugin, 'commandTest');
        },
        commandTest: function(session, cmd, arg) {
            this.chat(global.GameManager.GameName, false, session);
        }
    };
    Cheers!
     
  2. global.GameManager.Instance.GameName
     
  3. Well, I was trying it out earlier, but still nothing.

    Code:
    TypeError Instance is undefined
     
  4. Not sure how you get an Instance of a CSharp Singleton using JS. Might wanna Google it. I'll see if i can help you once I am at home
    [DOUBLEPOST=1454593182][/DOUBLEPOST]
    Try global.GameManager.getInstance().GameName
     
    Last edited by a moderator: Feb 4, 2016
  5. Nope, getInstance and GetInstance is not method of this object.
     
  6. Really don't know then, sorry.
     
  7. Fixed.
    For others:

    Code:
    global.Singleton(global.GameManager).Instance.GameName