/// <summary> /// Creates a new Gateway with given settings. /// </summary> /// <param name="uOSSettings"></param> public UnityGateway(uOSSettings uOSSettings, Logger logger, UOSApplication app = null) { this.settings = uOSSettings; this.logger = logger; this.reflectionServiceCaller = new ReflectionServiceCaller(uOSSettings, this); this.app = app; }
/// <summary> /// Initialises the uOS middleware with given app call handler and optional logger. /// </summary> /// <param name="app">The instance of of UOSApplication that will handle app service calls (it may be null).</param> /// <param name="plogger"></param> public static void Init(UOSApplication app, Logger plogger = null) { if (!ready) { if (plogger != null) { logger = plogger; } logger.Log("uOS init"); _instance._gateway = new UnityGateway(settings, logger, app); _instance._gateway.Init(); _instance._ready = true; } else { logger.LogWarning("uOS already initiated!"); } }
/// <summary> /// Initialises the uOS middleware with given app call handler and optional logger. /// </summary> /// <param name="app">The instance of of UOSApplication that will handle app service calls (it may be null).</param> /// <param name="plogger"></param> public static void Init(UOSApplication app, UOS.Logger plogger = null) { if (!ready) { if (plogger != null) logger = plogger; logger.Log("uOS init"); _instance._gateway = new UnityGateway(settings, logger, app); _instance._gateway.Init(); _instance._ready = true; } else logger.LogWarning("uOS already initiated!"); }