Namespace errors when importing Photon Voice

Options
I have an existing PUN+ project I want to integrate Photon Voice into. However, when I import the Photon Voice asset I get the following 4 errors:

"Assets/Photon Unity Networking/Demos/PunBasics-Tutorial/Scripts/GameManager.cs(25,43): error CS0234: The type or namespace name `MonoBehaviour' does not exist in the namespace `ExitGames.Photon'. Are you missing an assembly reference?

Assets/Photon Unity Networking/Demos/PunBasics-Tutorial/Scripts/Launcher.cs(25,40): error CS0234: The type or namespace name `PunBehaviour' does not exist in the namespace `ExitGames.Photon'. Are you missing an assembly reference?

Assets/Photon Unity Networking/Demos/PunBasics-Tutorial/Scripts/PlayerAnimatorManager.cs(17,53): error CS0234: The type or namespace name `MonoBehaviour' does not exist in the namespace `ExitGames.Photon'. Are you missing an assembly reference?

Assets/Photon Unity Networking/Demos/PunBasics-Tutorial/Scripts/PlayerManager.cs(22,45): error CS0234: The type or namespace name `PunBehaviour' does not exist in the namespace `ExitGames.Photon'. Are you missing an assembly reference?
"

I tried creating a blank new project, importing PUN+ and then Photon Voice but received the same errors so it doesn't appear to be an issue with my project.

I'm on Unity 5.3.5p6. I received the same issue on p4.

Comments

  • vadim
    Options
    PunBasics-Tutorial is not a part of PUN. So you can't have same errors when importing PUN in blank project.
    First check if PhotonVoice imported alone in blank project works for you. If yes, try merge PUN+ and PhotonVoice:
    - import PUN+ in blank project
    - import PhotonVoice skipping all existing files (do not override PUN+ files at this step)
    - copy (override) 4 files from full PhotonVoice installation (imported somewhere else) to PUN+ installation:
    Editor\PhotonNetwork\AccountService.cs
    Editor\PhotonNetwork\PhotonEditor.cs
    Editor\PhotonNetwork\ServerSettingsInspector.cs
    Plugins\PhotonNetwork\ServerSettings.cs

  • RKeown3D
    Options
    I'm able to re-create this with both PUN and PUN+. The recommended fix doesn't actually appear to work. Any updates on this?
  • RKeown3D
    Options
    Ok, there's actually 2 things going on here. The first is that there is a namspace conflict with thall scripts under under PUNVoice/DemoVoice/Scripts. their namespace is defined as ExitGames.Photon.DemoPunVoice. The problem is that the Photon is a PArent level namsepace entry (Defined in Photon Unity Networking/Plugins/PhotonNetwork/Photonclasses.cs), on its own, as well as being a sub-namespace entry under the ExitGames parent level namespace.

    the simple fix is to change all of the scripts namespace properties under PUNVoice/DeomVoice/Scripts to the following:

    namespace ExitGames.Demos.PunVoiceDemo

    from

    namespace ExitGames.Photon.PunVoiceDemo

    Save all of the scripts, and re-build the project.

    A second issue found is with the enum of PeerState, being renamed to ClientState. Replace all instances of PeerState. to ClientState.

    The project should now fully compile, and all included demos should work.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @RKeown3D,

    Thank you for your reports and suggested fix. We will look into it.
  • RKeown3D
    Options
    Anytime!!!!
  • jay
    Options
    I am not sure how to fix the problem but when I created a brand new project and only imported the Photon Voice package, everything seemed to work fine. I think the problem is that I tried to import the Photon Voice package into a project that already had Photon Unity Networking Package. I do not think that these two packages are playing nice with one another.

    I hope this gets fixed soon. I would really like to have voice chat in my game!
  • jeanfabre
    Options
    Hi,

    The problem has been addressed and will be available in the next update of Photon Voice. Meanwhile you can simply delete the pun voice demo to work.

    Thanks,

    Jean