Unity: "NetworkBehaviour" is missing - unity3d

I try to run the sample project from google AR Core here.
There is error in the sample code.
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
{
....
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.

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
and
com.unity.xr.legacyinputhelpers
as it was recommended here:
https://medium.com/#jeffreymlynch/where-are-the-missing-preview-packages-in-unity-2020-3ad0935e4193

use Window > Package Manager to install the Multiplayer HLAPI and XR Legacy Input Helpers packages.

Never mind the Multiplayer HLAPI and XR Legacy Input Helpers only available in unity version < 2020. In 2020 version, there is no option to install them both. The solution is I just downgrade the version into 2019.

Related

I don't know how to call using UnityEngine.XR.ARFoundation in a C# script inside my own Package in Unity

I don't know how to call using UnityEngine.XR.ARFoundation in a C# script inside my own Package in Unity.
I have added ARFoundation in Dependencies of Package as shown in the image. But I'm getting "error CS0246: The type or namespace name '~' could not be found (are you missing a using directive or an assembly reference?)". How can I resolve this?
I solved the problem by creating Assembly Difinition Files in my own package and adding references to Assembly Difinition References.
I fixed this issue in "Edit" ... "Preferences" ... "External Tools", by checking "Regenerate Project Files"; this hopefully regenerates all the necessary ".csproj" files for IntelliSense tracking.

using Unity.Plastic.Newtonsoft.Json not found in Rider

I'm trying to use:
using Unity.Plastic.Newtonsoft.Json
public static List<Level> GetLevels()
{
var asset = Resources.Load<TextAsset>("levels.json".Replace(".json", ""));
return JsonConvert.DeserializeObject<List<Level>>(asset.text);
}
and JsonConvert is in red.
and Plastic is showing in red. It says cannot resolve symbol Plastic.
Any ideas?
EDIT: I did install Newtonsoft.Json version 13 as assembly. No luck.
EDIT: using Newtonsoft.Json; also red.
Ok after some digging:
Apparently updated unity project which wiped out the dependency that was added via package manager > add package from git URL
Unity forgot a documented change for this. So, the answer:
Package Manager Window > Add Package from GIT URL > com.unity.nuget.newtonsoft-json
And instead of using using Unity.Plastic.Newtonsoft.Json
use using Newtonsoft.Json;
NOTE: On an older project where this was added manually, Newtonsoft Json wasn't showing up in the package manager > Packages: In Project until I went to the Cog Wheel > Checked Show Dependencies.

Am I doing something wrong with importing Oculus Integration in Unity?

When I go to the Asset Store in Unity and import the Oculus Integration I get 63 error messages.
I have tried re-installing Unity, it didn't work. I can't find anyone else having similar issues.
Error Messages:
Assets\Oculus\VR\Scripts\Util\OVRCursor.cs(22,19): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)
Assets\Oculus\VR\Scripts\Util\OVRInputModule.cs(25,35): error CS0246: The type or namespace name 'PointerInputModule' could not be found (are you missing a using directive or an assembly reference?)
Assets\Oculus\VR\Scripts\Util\OVRInputModule.cs(432,40): error CS0246: The type or namespace name 'MouseState' could not be found (are you missing a using directive or an assembly reference?)
There is many more like this, suggesting files are missing.
Unity Version 2019.3.0a3
Ok, this solves this problem, but either there is something wrong with Unity (tested 2019.2.0b4, 2019.1.4f1, and the 2019.3 versions) or Oculus Integration.
Add and a reference to Unity.ugui in Unity like in the picture.
I encountered a couple of compiler error as well, but those could just be commented as it was in sample code.
Make sure you run Unity Hub with administration rights and import Oculus Integration again
All VR components were renamed to XR.
Just double click on the errors and replace the lines of the Using statement with XR
e.g.
OVRTracker.cs
using VR = UnityEngine.VR;
// is changed to
using XR = UnityEngine.XR;
And the error will disappear.
I replaced VR with XR and it worked for everything except one boundary error.

Unity package manager issue

I Have The Latest Unity version and when i import package called
"PRO Military Customizable FPS Character v1.1_2PRO" it imports with two errors
E:/UP/FPPGame/Library/PackageCache/com.unity.package-manager-ui#1.9.11/Editor/Sources/UI/Common/PopupField.cs(8,36): error CS0246: The type or namespace name `BaseTextElement' could not be found. Are you missing an assembly reference?
E:/UP/FPPGame/Library/PackageCache/com.unity.package-manager-ui#1.9.11/Editor/Sources/UI/Common/PopupField.cs(118,33): error CS0115: `UnityEditor.PackageManager.UI.PopupField<T>.ExecuteDefaultAction(UnityEngine.Experimental.UIElements.EventBase)' is marked as an override but no suitable method found to override
And when i import the asset the package manager dissapear from window menu
what should i do ..
I had exactly the same issue on MacOS with Unity 2019.3.9f1.
Not a perfect solution, but upgrading to Unity 2019.3.10f1 instead solved it.

Facebook plugin for unity3D WP8 and METRO

I try to use facebooksdk.net in my WP8 Unity3D Plugin. Facebook.dll and Facebook.Client.dll and their fakes in correct folders, but error occure. Is there any way to fix it?
Error building Player: Exception: Failed to run assembly preprocessor with command line "Temp/StagingArea/Data/Managed\Facebook.Client.dll" -injectCtor -assemblyPath "Temp/StagingArea" -pdb.[Temp/StagingArea/Data/Managed\Facebook.Client.dll]
No symbols for Temp/StagingArea/Data/Managed\Facebook.Client.dll
Injecting ctor
Error while in assembly preprocessor Temp/StagingArea/Data/Managed\Facebook.Client.dll
Object reference not set to an instance of an object.
at AssemblyPreprocessor.Utils.IsBaseType(TypeDefinition definition, String name)
at AssemblyPreprocessor.Utils.IsFromNamespace(TypeDefinition definition, String namezpace)
at AssemblyPreprocessor.ConstructorInjector.ShouldInject(TypeDefinition typeDefinition)
at AssemblyPreprocessor.ConstructorInjector.InjectConstructorsForTypesIn(ModuleDefinition moduleDefinition)
at AssemblyPreprocessor.Program.Main(String[] args)
Facebook.dll use .NET Framework 4.5 libraries, and Windows Phone use .NET API for windows phone (http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207211(v=vs.105).aspx). You cant export this dll to WP8