public UnityConnectServiceData(string serviceName, string htmlSourcePath, CloudServiceAccess jsGlobalObject, string jsGlobalObjectName)
        {
            if (string.IsNullOrEmpty(serviceName))
            {
                throw new ArgumentNullException("serviceName");
            }

            if (string.IsNullOrEmpty(htmlSourcePath))
            {
                throw new ArgumentNullException("htmlSourcePath");
            }

            m_ServiceName            = serviceName;
            m_HtmlSourcePath         = htmlSourcePath;
            m_JavascriptGlobalObject = jsGlobalObject;
            m_JsGlobalObjectName     = jsGlobalObjectName;
            if (m_JavascriptGlobalObject != null)
            {
                //If no name is specified use the service name
                if (string.IsNullOrEmpty(m_JsGlobalObjectName))
                {
                    m_JsGlobalObjectName = m_ServiceName;
                }

                JSProxyMgr.GetInstance().AddGlobalObject(m_JsGlobalObjectName, m_JavascriptGlobalObject);
            }
        }
Esempio n. 2
0
 public UnityConnectServiceData(string serviceName, string htmlSourcePath, CloudServiceAccess jsGlobalObject, string jsGlobalObjectName)
 {
     if (string.IsNullOrEmpty(serviceName))
     {
         throw new ArgumentNullException("serviceName");
     }
     if (string.IsNullOrEmpty(htmlSourcePath))
     {
         throw new ArgumentNullException("htmlSourcePath");
     }
     this.m_ServiceName            = serviceName;
     this.m_HtmlSourcePath         = htmlSourcePath;
     this.m_JavascriptGlobalObject = jsGlobalObject;
     this.m_JsGlobalObjectName     = jsGlobalObjectName;
     if (this.m_JavascriptGlobalObject != null)
     {
         if (string.IsNullOrEmpty(this.m_JsGlobalObjectName))
         {
             this.m_JsGlobalObjectName = this.m_ServiceName;
         }
         JSProxyMgr.GetInstance().AddGlobalObject(this.m_JsGlobalObjectName, this.m_JavascriptGlobalObject);
     }
 }