コード例 #1
0
ファイル: FacebookItem.cs プロジェクト: ttat/puzzlewarrior
    public void SetItem(FacebookAppRequest appRequest)
    {
        this.AppRequest = appRequest;

        string description;
        string person = appRequest.FromName;

        string data = FacebookAppRequestDataParser.GetAppRequestObject(appRequest.Data);
        string dataType = FacebookAppRequestDataParser.GetAppDataType(appRequest.Data);

        switch (dataType)
        {
            case "MonsterUnlock":
                description = data;
                break;

            case "Inventory":
                description = ShopManager.VirtualGoodsDictionary[data].Name;

                break;

            default:
                description = "Unknown";
                break;
        }

        switch (FacebookAppRequestDataParser.GetAppRequestType(appRequest.Data))
        {
            case FacebookAppRequest.AppRequestType.Gift:
                this.Message.text = string.Format("Accept {0} from {1}", description, person);
                this.ButtonLabel.text = "Accept";
                break;

            case FacebookAppRequest.AppRequestType.Request:
                this.Message.text = string.Format("Send {0} to {1}", description, person);
                this.ButtonLabel.text = "Send";
                break;
        }
    }
コード例 #2
0
 public FacebookAppRequestDeletedEventArgs(FacebookAppRequest deletedAppRequest)
 {
     this.DeletedAppRequest = deletedAppRequest;
 }