示例#1
0
 private void ToggleFacebook()
 {
     if (BackendManager.ConnectedWithFacebook)
     {
         BackendManager.DisconnectWithFacebook();
         List <ArenaPlayerHUD> list            = new List <ArenaPlayerHUD>();
         ArenaPlayerHUD[]      arenaPlayerHUDs = MenuController.GetMenu <GameMenu>().arenaPlayerHUDs;
         if (arenaPlayerHUDs != null && arenaPlayerHUDs.Length != 0)
         {
             list.AddRange(arenaPlayerHUDs);
         }
         arenaPlayerHUDs = MenuController.GetMenu <GameMenu>().arenaMultiplayerHUDs;
         if (arenaPlayerHUDs != null && arenaPlayerHUDs.Length != 0)
         {
             list.AddRange(arenaPlayerHUDs);
         }
         foreach (ArenaPlayerHUD item in list)
         {
             if ((bool)item.profilePicture)
             {
                 item.profilePicture.texture = null;
             }
         }
         facebookButton.SetToggled(toggled: false);
     }
     else
     {
         facebookButton.SetDisabled();
         BackendManager.ConnectWithFacebook(delegate
         {
             facebookButton.SetToggled(toggled: true);
         }, delegate
         {
             facebookButton.SetToggled(toggled: false);
         });
     }
 }