// Use this for initialization void Start() { FacebookAPI.GetFriendsID(IDs => { foreach (var ID in IDs) { UserPreference.GetPreferencefromID(ID, userPreference => { string friendsName = userPreference.name; GameObject SendeeNodeInstance = Instantiate(SendeeNodePrefab, SendeeViewContent.transform); SendeeNodeInstance.SendMessage("Init", friendsName); SendeeNodeInstance.SendMessage("InitID", ID); }); } }); }
// Use this for initialization void Start() { UserPreference.GetPreferencefromID(targetUserId, userPreference => { if (userPreference != null) { Dictionary <string, object> _likeDic = Json.Deserialize(userPreference.json) as Dictionary <string, object>; Dictionary <string, int> likeDic = _likeDic.ToDictionary(c => c.Key, c => (int)(long)c.Value); List <string> sortLikeList = likeDic.OrderByDescending(c => c.Value).Select(c => c.Key).ToList(); for (int i = 0; i < HigherRankingCount; i++) { GameObject CategoryNodeInstance = Instantiate(CategoryNodePrefab, CategoryViewContent.transform); CategoryNodeInstance.SendMessage("Init", sortLikeList[i]); } } }); }