【问题标题】:Adding CS2AFHelperClasses.cs or PlayFab.Samples in Azure portal在 Azure 门户中添加 CS2AFHelperClasses.cs 或 PlayFab.Samples
【发布时间】:2022-01-19 01:06:06
【问题描述】:

我正在 Unity 中编写游戏,在 Playfab 服务器中保存数据,并使用 Playfab API 连接两者。

云函数必须在 Azure 中完成,所以我在 Azure 门户中创建了一个 Azure 函数(HTTP 类型)。

但是根据第一次测试,我需要将文件 CS2AFHelperClasses.cs (PlayFab.Samples) 添加到我的 Azure 项目中。我没有找到这样做的方法。

遵循此文档: https://docs.microsoft.com/en-us/gaming/playfab/features/automation/cloudscript-af/quickstart

这是必须添加到项目中的文件: https://github.com/PlayFab/PlayFab-Samples/blob/master/Samples/CSharp/AzureFunctions/CS2AFHelperClasses.cs

我在 Azure 门户中工作。

【问题讨论】:

  • 关于这个问题的任何更新?这个答案解决了你的问题吗?

标签: c# azure unity3d azure-functions playfab


【解决方案1】:

Hello World 示例总是很好,请参阅下面的 HelloWorld 示例,您可以将其用作您的第一个 Azure 函数。要编译和运行示例,您需要包含 CS2AFHelperClasses.cs 文件,该文件包含 PlayFab.Samples 命名空间的实现。

要从 PlayFab SDK 调用 HelloWorld Azure 函数,请使用 ExecuteFunction

执行以下步骤在 Azure 门户中注册函数

  1. 创建一个基本的HelloWorld 示例函数。您可以按照使用Visual Studio Code guide 创建您的第一个函数来了解如何执行此操作。有关使用 PlayFab 变量的代码示例,请参阅 PlayFab Function Context, Variables and using the Server SDKs.

    部分
  2. 创建和部署函数后,选择函数(预览)页面右上角的注册函数按钮。

  3. 对于名称,为您的函数输入一个易于理解的名称。对于函数 URL,输入函数的 HTTP 触发器 URL。该 URL 可以在部署的输出中找到。

创建规则和调度任务,可以参考Azure Function Rules

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-21
    • 1970-01-01
    相关资源
    最近更新 更多