Пример #1
0
 private void GetPrivateMessage(string sender, object message)
 {
     ///current player send "invate" to friend
     if (message.ToString() == INVATE)
     {
         if (sender != UserID)
         {
             InvatedFriendID = sender;
             InvatePanelPopup.SetActive(true);
         }
         else
         {
             WaitPanelPopup.SetActive(true);
         }
     }
     ///Answer from current user friend
     if (message.ToString() == NO)
     {
         if (sender != UserID)
         {
             SelectedFriendID = string.Empty;
             WaitPanelPopup.SetActive(false);
         }
         else
         {
             InvatedFriendID = string.Empty;
             InvatePanelPopup.SetActive(false);
         }
     }
     ///Current user cancel invate
     if (message.ToString() == CANCEL)
     {
         if (sender != UserID)
         {
             InvatedFriendID = string.Empty;
             InvatePanelPopup.SetActive(false);
         }
         else
         {
             SelectedFriendID = string.Empty;
             WaitPanelPopup.SetActive(false);
         }
     }
     ///Friend of currend user ready to play
     if (message.ToString() == OK)
     {
         if (sender != UserID)
         {
             WaitPanelPopup.SetActive(false);
             ActionManager.Action_DoCreateFriendRoom(SelectedFriendID);
         }
         else
         {
             InvatePanelPopup.SetActive(false);
             ActionManager.Action_DoJoinFriendRoom(InvatedFriendID);
         }
     }
 }