microsoft / MixedReality-SpectatorView

Mixed reality spectator experiences
MIT License
193 stars 113 forks source link

StateSynchronization error CS1061 #402

Open ZaidZaim opened 3 years ago

ZaidZaim commented 3 years ago

Hello @chrisfromwork, Hope you are doing well!

I am using Unity 2020.1

I created the Unity Package com.microsoft.mixedreality.spectatorview.1.2.0 . I made a SetupRepository and copied the Plugins.

When I open the SpectatorviewExample.Unity I get the follwing errors:

\Documents\GitHub\MixedReality-SpectatorView\packages\com.microsoft.mixedreality.spectatorview.1.2.0\SpectatorView\Scripts\StateSynchronization\NetworkedComponents\TextMeshPro\TextMeshProBroadcasterBase.cs(141,50): error CS1061: 'TMP_Text' does not contain a definition for 'ignoreRectMaskCulling' and no accessible extension method 'ignoreRectMaskCulling' accepting a first argument of type 'TMP_Text' could be found (are you missing a using directive or an assembly reference?)

\Documents\GitHub\MixedReality-SpectatorView\packages\com.microsoft.mixedreality.spectatorview.1.2.0\SpectatorView\Scripts\StateSynchronization\NetworkedComponents\TextMeshPro\TextMeshProBroadcasterBase.cs(236,48): error CS1061: 'TMP_Text' does not contain a definition for 'ignoreRectMaskCulling' and no accessible extension method 'ignoreRectMaskCulling' accepting a first argument of type 'TMP_Text' could be found (are you missing a using directive or an assembly [reference?)

I tried then to do the following:

Obtain your HoloLens's ip address from its windows settings menu via Settings -> Network & Internet -> Wi-Fi -> Hardware Properties. Add any of the preprocessor directives or Unity packages described above that you intend to use to your clone of the SpectatorView codebase. If you would like to synchronize Text Mesh Pro UI, you will need to add the STATESYNC_TEXTMESHPRO preprocessor directive to the UWP, iOS and Android Player Settings (This is located via Build Settings -> Player Settings -> Other Settings -> 'Scripting Defined Symbols').

But I did not came over the error.

I want to make the Application for HoloLens 1 with the ArUco Marker Detection

chrisfromwork commented 3 years ago

This sounds like the text mesh pro package that you've referenced in your project does not match what we were using with the spectator view samples. I would guess that Unity 2020.1 may require a newer version of text mesh pro that may not have been supported in Unity 2019.2. This is one of the difficulties in moving forward in Unity versions.

If you aren't using text mesh pro, you can just delete the line in TextMeshProBroadcasterBase.cs causing the build error. This class assesses all the variables on TMP_TEXT in order to synchronize it over the network with your mobile device. If you have no text mesh pro content in your app, then this class won't get created or do anything.

If you are using text mesh pro, it may be that ignoreRectMaskCulling was renamed, has a new type, or was removed from TMP_TEXT in the newer version of text mesh pro you are using. An appropriate fix would be to update the synchronization stack to use whatever new name or type is being used. If the argument was removed from TMP_Text, you should be able to delete the line without any problems.

FWIW, the documentation call out to add the STATESYNC_TEXTMESHPRO preprocessor directive is stale. It is no longer needed and we need to remove it from the documentation.