示例#1
0
    public void AddFriendsData(string friendID)
    {
        if (_friendList.Count >= MAX_FRIEND_COUNT)
        {
            CommonDebug.LogWarning("친구 목록이 가득 찼습니다.");
            return;
        }

        for (int i = 0; i < _friendDataKeyList.Count; i++)
        {
            string friendKey   = _friendDataKeyList[i];
            string friendValue = PlayerPrefs.GetString(friendKey);

            if (string.IsNullOrEmpty(friendValue))
            {
                PlayerPrefs.SetString(friendKey, friendID);
                break;
            }
        }

        _friendList.Add(friendID);

        PlayerPrefs.Save();

        ChatManager.Instance.AddFriend(friendID);
    }
示例#2
0
    public void RemoveFriendsData(string friendID)
    {
        if (_friendList.Count == 0)
        {
            CommonDebug.LogWarning("저장된 친구가 없습니다.");
            return;
        }

        for (int i = 0; i < _friendDataKeyList.Count; i++)
        {
            string friendKey   = _friendDataKeyList[i];
            string friendValue = PlayerPrefs.GetString(friendKey);

            if (friendValue.Equals(friendID))
            {
                PlayerPrefs.SetString(friendKey, string.Empty);
                break;
            }
        }

        _friendList.Remove(friendID);

        PlayerPrefs.Save();

        ChatManager.Instance.RemoveFriend(friendID);
    }
示例#3
0
 public void DebugReturn(DebugLevel level, string message)
 {
     if (level == DebugLevel.ERROR)
     {
         CommonDebug.LogError(message);
     }
     else if (level == DebugLevel.WARNING)
     {
         CommonDebug.LogWarning(message);
     }
     else
     {
         CommonDebug.Log(message);
     }
 }