public void AddSelectedFriend(Fresvii.AppSteroid.Models.User user, Action<bool> callback)
        {
            foreach (Fresvii.AppSteroid.Models.User _user in selectedUsers)
            {
                if (_user.Id == user.Id)
                {
                    return;
                }
            }

            if (selectedUsers.Count >= SelectableMaxCount)
            {
                string tooMuch = FresviiGUIText.Get("SelectFrindsOvered").Replace("%num", SelectableMaxCount.ToString());

                Fresvii.AppSteroid.Util.DialogManager.Instance.ShowSubmitDialog(tooMuch, FresviiGUIText.Get("OK"), FresviiGUIText.Get("OK"), FresviiGUIText.Get("OK"), (del) => { });

                if (callback != null)
                {
                    callback(false);
                }
            }
            else
            {
                selectedUsers.Add(user);

                if (callback != null)
                {
                    callback(true);
                }
            }

            selectMemberTop.SetSubmit((selectedUsers.Count > 0));
        }
        void OnGetStickerSetList(IList<Fresvii.AppSteroid.Models.StickerSet> stickerSets, Fresvii.AppSteroid.Models.ListMeta meta, Fresvii.AppSteroid.Models.Error error)
        {
            if (this == null)
            {
                return;
            }

            if (this.enabled == false)
            {
                return;
            }

            if (error != null)
            {
                if (FASSettings.Instance.logLevel <= FAS.LogLevels.Error)
                {
                    Debug.LogError(error.ToString());
                }

                return;
            }

            if (this.listMeta == null || this.listMeta.CurrentPage != 0)
            {
                this.listMeta = meta;
            }

            foreach (var stickerSet in stickerSets)
            {
                UpdateStickerSet(stickerSet);
            }

            pullReflesh.PullRefleshCompleted();
        }
        public void SetEventboard(Fresvii.AppSteroid.Models.Eventboard eventboard, AUIGameEvent auiGameEvent)
        {
            this.auiGameEvent = auiGameEvent;

            this.Eventboard = eventboard;

            this.textTitle.text = Eventboard.Leaderboard.Name;

            this.textRankingScore.text = Eventboard.Leaderboard.Description;

            if (string.IsNullOrEmpty(Eventboard.Leaderboard.IconUrl))
            {
                FASLeaderboard.GetLeaderboard(Eventboard.Leaderboard.IconUrl, (leaderboard, error) =>
                {
                    if (error == null)
                    {
                        image.Set(leaderboard.IconUrl);
                    }
                });
            }
            else
            {
                image.Set(Eventboard.Leaderboard.IconUrl);
            }
        }
        public void GoToEventboard(Fresvii.AppSteroid.Models.Eventboard eventboard)
        {
            if (frame.Animating) return;

            RectTransform rectTransform = GetComponent<RectTransform>();

            var auiEventboard = ((GameObject)Instantiate(prfbEventboard)).GetComponent<AUIEventboard>();

            auiEventboard.SetEventboard(eventboard);

            auiEventboard.transform.SetParent(transform.parent, false);

            auiEventboard.transform.SetAsLastSibling();

            auiEventboard.parentFrameTween = this.frame;

            //auiEventboard.backButtonText.text = title.text;

            auiEventboard.frame.backFrame = this.frame;

            auiEventboard.frame.Animate(new Vector2(rectTransform.rect.width, 0f), Vector2.zero, () => { });

            this.frame.Animate(Vector2.zero, new Vector2(-rectTransform.rect.width * 0.5f, 0f), () =>
            {
                this.gameObject.SetActive(false);
            });
        }
        public void GoToGameEvent(Fresvii.AppSteroid.Models.GameEvent gameEvent)
        {
            if (Application.internetReachability == NetworkReachability.NotReachable)
            {
                Fresvii.AppSteroid.Util.DialogManager.Instance.ShowSubmitDialog(FASText.Get("Offline"), FASText.Get("OK"), FASText.Get("Cancel"), FASText.Get("Close"), (del) => { });

                return;
            }

            RectTransform rectTransform = GetComponent<RectTransform>();

            GameObject goGameEvent = Instantiate(prfbAUIGameEvent) as GameObject;

            AUIGameEvent auiGameEvent = goGameEvent.GetComponent<AUIGameEvent>();

            auiGameEvent.GameEvent = gameEvent;

            goGameEvent.transform.SetParent(transform.parent, false);

            goGameEvent.gameObject.SetActive(true);

            goGameEvent.transform.SetAsLastSibling();

            AUIFrame nextFrame = auiGameEvent.frame;

            nextFrame.backFrame = this.frame;

            nextFrame.Animate(new Vector2(rectTransform.rect.width, 0f), Vector2.zero, () => { });

            frame.Animate(Vector2.zero, new Vector2(-rectTransform.rect.width * 0.5f, 0f), () =>
            {
                this.gameObject.SetActive(false);
            });
        }
 public void StickerSelected(Fresvii.AppSteroid.Models.Sticker sticker)
 {
     if (OnStickerSelected != null)
     {
         OnStickerSelected(sticker);
     }
 }
        public void SetFriend(Fresvii.AppSteroid.Models.Friend friend, AUIFriendList parentPage)
        {
            this.Friend = friend;

            this.parentPage = parentPage;

            this.user = this.Friend.ToUser();

            if (this.user.Id == FAS.CurrentUser.Id)
            {
                tagLabel.gameObject.SetActive(true);

                tagText.text = FASText.Get("You");

                if (!tagSized)
                {
                    userName.rectTransform.sizeDelta = new Vector2(userName.rectTransform.sizeDelta.x - tagLabel.rectTransform.sizeDelta.x - 30f, userName.rectTransform.sizeDelta.y);

                    tagSized = true;
                }
            }

            userIcon.Set(user.ProfileImageUrl);

            userName.text = user.Name;
        }
        public void SetApp(Fresvii.AppSteroid.Models.App addApp, AUIRecommendedApps AUIRecommendedApps)
        {
            this.AUIRecommendedApps = AUIRecommendedApps;

            if (addApp == null)
            {
                if (banner != null)
                    banner.gameObject.SetActive(false);

                appIcon.gameObject.SetActive(false);

                textAppName.gameObject.SetActive(false);

                textDeveloperName.gameObject.SetActive(false);

                button.interactable = false;
            }
            else
            {
                this.AddApp = addApp;

                if (banner != null)
                    banner.Set(this.AddApp.IconUrl);

                appIcon.Set(this.AddApp.IconUrl);

                textAppName.text = this.AddApp.Name;

                textDeveloperName.text = this.AddApp.GameGenres[0].Name;
            }
        }
    void OnMatchMakingMatchCompleted(Fresvii.AppSteroid.Models.Match match)
    {
        if (completeMatch == null)
        {
            completeMatch = match;
        }
        else if (completeMatch.Id == match.Id)
        {
            return;
        }
        else
        {
            completeMatch = match;
        }

        if (!(Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer))
        {
            Application.LoadLevel(loadSceneNameOnMatchCompleted);
        }
        else
        {
            Fresvii.AppSteroid.Util.DialogManager.Instance.SetLabel("Yes", "No", "Close");

            Fresvii.AppSteroid.Util.DialogManager.Instance.ShowSelectDialog("Match completed! Sample Game?", delegate(bool del)
            {
                if (del)
                {
                    Application.LoadLevel(loadSceneNameOnMatchCompleted);
                }
            });
        }
    }
        public void GoToAppDetail(Fresvii.AppSteroid.Models.App app)
        {
            FASUtility.SendPageView("event.ad.click.store", this.App.Id, System.DateTime.UtcNow, (e) =>
            {
                if (e != null)
                    Debug.LogError(e.ToString());

                Application.OpenURL(this.App.StoreUrl);
            });

            /*if (parentFrame.Animating) return;

            RectTransform rectTransform = GetComponent<RectTransform>();

            var auiAppDetail = ((GameObject)Instantiate(prfbAppDetail)).GetComponent<AUIAppDetail>();

            auiAppDetail.SetApp(app);

            auiAppDetail.transform.SetParent(parentFrame.transform.parent, false);

            auiAppDetail.transform.SetAsLastSibling();

            auiAppDetail.frame.backFrame = this.parentFrame;

            auiAppDetail.frame.Animate(new Vector2(rectTransform.rect.width, 0f), Vector2.zero, () => { });

            this.parentFrame.Animate(Vector2.zero, new Vector2(-rectTransform.rect.width * 0.5f, 0f), () =>
            {
                parentFrame.gameObject.SetActive(false);
            });*/
        }
        public void GoToDirectMessage(IList<Fresvii.AppSteroid.Models.DirectMessage> directMessages, Fresvii.AppSteroid.Models.ListMeta meta, bool animation)
        {
            if (frameTween.Animating || AUISlideButton.open) return;

            scrollView.StopScroll();

            RectTransform rectTransform = GetComponent<RectTransform>();

            AUIDirectMessages directMessagesPage = ((GameObject)Instantiate(prfbDirectMessages)).GetComponent<AUIDirectMessages>();

            directMessagesPage.listMeta = meta;

            directMessagesPage.transform.SetParent(transform.parent, false);

            directMessagesPage.transform.SetAsLastSibling();

            directMessagesPage.parentFrameTween = this.frameTween;

            if (animation)
            {
                directMessagesPage.frameTween.Animate(new Vector2(rectTransform.rect.width, 0f), Vector2.zero, () => { });

                this.frameTween.Animate(Vector2.zero, new Vector2(-rectTransform.rect.width * 0.5f, 0f), () =>
                {
                    this.gameObject.SetActive(false);
                });
            }
            else
            {
                directMessagesPage.frameTween.SetPosition(Vector2.zero);

                this.gameObject.SetActive(false);
            }
        }
        public void SetPreview(Fresvii.AppSteroid.Models.Video video, AUIPreviewVideoList auiPreviewVideoList)
        {
            this.auiPreviewVideoList = auiPreviewVideoList;

            this.Video = video;

            videoThumbnail.Set(this.Video.ThumbnailUrl);

            if (this.Video.App != null)
            {
                appIcon.Set(this.Video.App.IconUrl);

                textAppName.text = this.Video.App.Name;

                if (this.Video.App.GameGenres.Count > 0)
                    textGameCategory.text = this.Video.App.GameGenres[0].Name;

            }

            uint min = video.Duration / 60;

            uint sec = video.Duration % 60;

            uploadedText.text = video.CreatedAt.ToLocalTime().ToString(FASText.Get("LocalDateFormat")) + " " + FASText.Get("Uploaded");

            durationText.text = min + ":" + sec.ToString("00");
        }
        public void GoToGameEvent(Fresvii.AppSteroid.Models.GameEvent gameEvent)
        {
            RectTransform rectTransform = GetComponent<RectTransform>();

            GameObject goGameEvent = Instantiate(prfbAUIGameEvent) as GameObject;

            AUIGameEvent auiGameEvent = goGameEvent.GetComponent<AUIGameEvent>();

            auiGameEvent.GameEvent = gameEvent;

            goGameEvent.transform.SetParent(transform.parent, false);

            goGameEvent.gameObject.SetActive(true);

            goGameEvent.transform.SetAsLastSibling();

            AUIFrame nextFrame = auiGameEvent.frame;

            nextFrame.backFrame = this.frame;

            nextFrame.Animate(new Vector2(rectTransform.rect.width, 0f), Vector2.zero, () => { });

            frame.Animate(Vector2.zero, new Vector2(-rectTransform.rect.width * 0.5f, 0f), () =>
            {
                this.gameObject.SetActive(false);
            });
        }
        public void SetStickerSet(Fresvii.AppSteroid.Models.StickerSet stickerSet, AUIStickerSetSelector selector)
        {
            this.StickerSet = stickerSet;

            this.selector = selector;

            image.Set(this.StickerSet.Url);
        }
        public void SetSticker(Fresvii.AppSteroid.Models.Sticker sticker, AUIStickerSelector stickerSelector)
        {
            this.Sticker = sticker;

            this.stickerSelector = stickerSelector;

            image.Set(sticker.Url);
        }
        public void SetUserAgreement(Fresvii.AppSteroid.Models.UserAgreement userAgreement, Action<bool> callback)
        {
            this.UserAgreement = userAgreement;

            this.callback = callback;

            userAgreementText.text = userAgreement.Text;
        }
        public void SetThread(Fresvii.AppSteroid.Models.Thread thread, bool isApp, System.Action<Fresvii.AppSteroid.Models.Thread> OnClickCell)
        {
            this.OnClickCell = OnClickCell;

            this.isApp = isApp;

            UpdateThread(thread);
        }
        public void SetComment(Fresvii.AppSteroid.Models.Comment comment, AUICommunityTop communityTop)
        {
            this.communityTop = communityTop;

            if (this.Comment == null || this.Comment.Id != comment.Id)
            {
                this.Comment = comment;
            }
        }
        public void SetPlayer(Fresvii.AppSteroid.Models.Player player, AUIMatchMaking parentPage)
        {
            this.Player = player;

            this.parentPage = parentPage;

            userIcon.Set(Player.User.ProfileImageUrl);

            UpdateCell();
        }
        public void SetComment(Fresvii.AppSteroid.Models.Comment comment, AUIForum auiForum)
        {
            this.Comment = comment;

            this.auiForum = auiForum;

            if (this.gameObject.activeInHierarchy)
            {
                StartCoroutine(Set());
            }
        }
        public void SetApp(Fresvii.AppSteroid.Models.App addApp)
        {
            this.AddApp = addApp;

            appIcon.Set(this.AddApp.IconUrl);

            textAppName.text = this.AddApp.Name;

            if (this.AddApp.GameGenres.Count > 0)
                textGameCategory.text = this.AddApp.GameGenres[0].Name;
        }
    void OnDeleteSnsAccount(Fresvii.AppSteroid.Models.Error error)
    {
        if (error != null)
        {
            logMessage = error.ToString(); ;
            Debug.LogError(logMessage);
            return;
        }

        logMessage = "Delete Success";
        Debug.Log(logMessage);
    }
        public void Set(Fresvii.AppSteroid.Models.Stat stat, Color color)
        {
            this.Stat = stat;

            labelText.text = stat.Label;

            labelText.color = color;

            valueText.text = (string)stat.Value;

            valueText.color = color;
        }
        public void SetLeaderboard(Fresvii.AppSteroid.Models.Leaderboard leaderboard, AUILeaderboardList parentPage)
        {
            this.Leaderboard = leaderboard;

            this.parentPage = parentPage;

            leaderboardName.text = leaderboard.Name;

            despcription.text = leaderboard.Description;

            icon.Set(leaderboard.IconUrl);
        }
        public void SetFriend(Fresvii.AppSteroid.Models.Friend friend, AUIMatchmakingSelectFriends parentPage, bool isSelected)
        {
            this.Friend = friend;

            this.parentPage = parentPage;

            this.IsSelected = isSelected;

            userName.text = friend.Name;

            GetUser();

            buttonCheck.Set(this.IsSelected);
        }
    void OnGetSnsAccountList(IList<Fresvii.AppSteroid.Models.SnsAccount> snsAccountList, Fresvii.AppSteroid.Models.Error error)
    {
        if (error != null)
        {
            Debug.LogError(error.ToString());
            return;
        }

        logMessage = "";
        foreach (Fresvii.AppSteroid.Models.SnsAccount snsAccount in FAS.Instance.Client.User.SnsAccounts)
            logMessage += snsAccount.Id + ", " + snsAccount.Provider + ", " + snsAccount.Uid + ", " + snsAccount.CreatedAt + ", " + snsAccount.UpdatedAt + "\n";

        Debug.Log(logMessage);
    }
        public void SetGameEvent(Fresvii.AppSteroid.Models.GameEvent gameEvent, System.Action<Fresvii.AppSteroid.Models.GameEvent> OnClick)
        {
            this.OnClickCallback = OnClick;

            this.GameEvent = gameEvent;

            image.Set(GameEvent.ImageUrl);

            eventNameText.text = this.GameEvent.Name;

            if (this.OnClickCallback == null)
            {
                this.gameObject.GetComponent<Button>().interactable = false;
            }
        }
        public static void Show(int guiDepth, Fresvii.AppSteroid.Models.Video video, Texture2D videoThumbnail)
        {
            if (instance != null)
            {
                Destroy(instance.gameObject);
            }

            Instantiate(Resources.Load("GuiPrefabs/VideoSharingGUI"));

            instance.guiDepth = guiDepth;

            instance.onlySharing = true;

            instance.shareVideo.Set(instance, video, videoThumbnail);
        }
Beispiel #29
0
    // チャットパネルを表示・非表示
    public void ShowChat(string title, Fresvii.AppSteroid.Models.Group group)
    {
        if(!chatCanvas.enabled) {
            chatCanvas.enabled = true;
            inGameChatGroup = group;
            GameObject.Find("Chat_Title").GetComponent<Text>().text = title;

            if(inGameChatGroup != null) {
                //logMessage += "グループIDは" + inGameChatGroup.Id + "\n";
                logMessage += "チャット開始" + "\n";
            } else {
                logMessage += "グループIDが取得できていません" + "\n";
            }
        }
    }
        public void SetApp(Fresvii.AppSteroid.Models.App addApp, AUIFrame parentFrame)
        {
            this.parentFrame = parentFrame;

            this.App = addApp;

            bannerImage.delayCount = transform.GetSiblingIndex() * 10;

            bannerImage.Set(this.App.BannerImageUrl, (obj) =>
            {
                if(!Showing)
                    gameObject.SetActive(false);

                TextureIsReady = true;
            });
        }