Unity:缺少“NetworkBehaviour”

Alv*_*nus 2 unity-game-engine

我尝试在此处从 google AR Core 运行示例项目。

示例代码中有错误。

错误 CS0246:找不到类型或命名空间名称“NetworkBehaviour”(您是否缺少 using 指令或程序集引用?)

using GoogleARCore;
using GoogleARCore.CrossPlatform;
using UnityEngine;
using UnityEngine.Networking;

/// <summary>
/// A Controller for the Anchor object that handles hosting and resolving the Cloud Anchor.
/// </summary>
public class AnchorController : NetworkBehaviour
{
    ....
Run Code Online (Sandbox Code Playgroud)

我正在使用该2020.1.0f1版本。我能做些什么来解决这个问题?据说已弃用,而新的替代品仍在开发中。

已弃用但不能使用,目前没有替代品。我被困在这里。

Zeg*_*hra 5

对于 Unity 2020,我使用了 Window > Package Manager 并按下了 +(加号):Add Package from git URL 并将其设置为:

  • com.unity.multiplayer-hlapi

  • com.unity.xr.legacyinputhelpers

正如这里推荐的那样:https : //medium.com/@jeffreymlynch/where-are-the-missing-preview-packages-in-unity-2020-3ad0935e4193