Unity:“网络行为"不见了 [英] Unity: "NetworkBehaviour" is missing

查看:47
本文介绍了Unity:“网络行为"不见了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试从 google AR Core 这里运行示例项目.

I try to run the sample project from google AR Core here.

示例代码中存在错误.

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

error CS0246: The type or namespace name 'NetworkBehaviour' could not be found (are you missing a using directive or an assembly reference?)

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
{
    ....

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

I am using the 2020.1.0f1 version. What can I do to fix this? It is said deprecated while the new replacement is still under development.

已弃用但无法使用,目前没有替代品.我被困在这里了.

Deprecated but cannot be used and there is no replacement at the moment. I am stuck here.

推荐答案

对于 Unity 2020,我使用了 Window >包管理器并按下 +(加号):从 git URL 添加包并将其设置为:

For Unity 2020, I used Window > Package Manager and pressed the + (plus) sign: Add Package from git URL and set it to:

  • com.unity.multiplayer-hlapi

  • com.unity.xr.legacyinputhelpers

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

这篇关于Unity:“网络行为"不见了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆