Beispiel #1
0
        public GameObject Show(UIMap.Id _viewId)
        {
            Loggr.Log("attempt to instantiate: " + _viewId.ToString());

            if (resourceManager == null)
            {
                Debug.Log("NULLLLL");
            }

            if (uiElements.ContainsKey(_viewId))
            {
                Loggr.Log("already exist: " + _viewId.ToString());
                return(uiElements[_viewId]);
            }

            var resourcePath = UIMap.GetPath(_viewId);
            var view         = resourceManager.GetResource <GameObject>(resourcePath);

            var instance = GameObject.Instantiate(view as GameObject) as GameObject;

            instance.transform.SetParent(container.transform);
            instance.transform.localPosition = Vector3.zero;

            localeService.SetAllTexts(instance.gameObject);

            uiElements[_viewId] = instance;

            return(instance);
        }
Beispiel #2
0
 void onInitComplete(Promise <IAsyncCommand> _promise)
 {
     if (FB.IsInitialized)
     {
         FB.ActivateApp();
         Loggr.Log("FB app initialized");
         _promise.Resolve(this);
     }
     else
     {
         Loggr.Log("Failed to init FB");
         _promise.Reject(new Exception("Can't init Facebook SDK."));
     }
 }
Beispiel #3
0
 protected static void SetGeoIP(Loggr.FluentEvent ev)
 {
     string ip = "";
     if (HttpContext.Current != null)
     {
         ip = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
         if (String.IsNullOrEmpty(ip))
         {
             ip = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
         }
         if (!String.IsNullOrEmpty(ip))
             ev.GeoIP(ip);
     }
 }
 void onLoginComplete(Promise <IAsyncCommand> _promise)
 {
     if (FB.IsLoggedIn)
     {
         var aToken = Unifb.AccessToken.CurrentAccessToken;
         // Print current access token's User ID
         Loggr.Log(aToken.UserId);
         // Print current access token's granted permissions
         foreach (string perm in aToken.Permissions)
         {
             Loggr.Log(perm);
         }
         _promise.Resolve(this);
     }
     else
     {
         Loggr.Log("Fail to login in FB");
         _promise.Reject(new Exception("Fail to login in FB"));
     }
 }
 private void Login()
 {
     Loggr.Log($"Logging in user {Username} to {SelectedServer}");
     Javascripter.Login(Browser, SelectedServer, Username, Password);
     IsLoggedIn = true;
 }