Photon View - incorrect name

Hello.
The "Photon View" component can't be added through the inspector because the name is spelled wrong somewhere.
https://imgur.com/a/QAGsJuK

But it can be added correctly through the top left component drop down.

Comments

  • Thanks for mentioning it can be added through the component drop down, you just saved me from a headache.

    Adding some info to the problem (at least as it exists on my end), trying to add the component through the inspector throws this specific error-

    ExecuteMenuItem failed because there is no menu named 'Component/Photon Networking/Photon View &v'
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @bibbis, @heavenlyalchemy,

    Thank you for choosing Photon!

    What PUN version and Unity versions are you using?
  • bibbis
    bibbis
    edited December 2018
    Hi,
    I'm really loving PUN, it's ridiculously easy to use.

    I'm currently on the latest version of Photon 2 (v2.5 (20th November 2018)) and Unity 2018.3.0f2.
    I've used several of the previous 2018.3 beta Unity version as well, and this has been a problem ever since I started using Photon a couple of months ago.

    Adding some info to the problem (at least as it exists on my end), trying to add the component through the inspector throws this specific error-

    ExecuteMenuItem failed because there is no menu named 'Component/Photon Networking/Photon View &v'
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

    I'm getting that error message as well.
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited January 2019
    Could you try removing the "&v" part in "PhotonView.cs":

    so instead of:
        [AddComponentMenu("Photon Networking/Photon View &v")]
    
    this:
        [AddComponentMenu("Photon Networking/Photon View")]
    
    EDIT: make sure to restart Unity after making the change.
  • @JohnTube Yeah that worked.
    When I change it and Unity recompiles, at first there are 2 PhotonViews:
    https://imgur.com/a/wILx1Sm

    But after closing and reopening the project, the "&v" version disappears.
    I'm not getting any errors or issues when adding or using PhotonViews now.

    Thank you for the help!
  • Funesto
    Funesto
    edited January 2019
    I've got some troubles too ... I can't "Add Component" anymore :-( I also removed that "&v" but still nothing!

    EDIT: Wait, right now I restarted Unity ad it seems I can click again "Add Component"
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Funesto,

    Thank you for choosing Photon!

    Did you try closing and reopening Unity Editor after removing "&v"?
  • FIFTYTWO
    FIFTYTWO
    edited April 2019
    The latest PUN 2.9 in the Asset Store has [AddComponentMenu("Photon Networking/Photon View")] which causes the following error in Unity 2019.1.0f2 when go to Play mode:
    ArgumentException: Object at index 0 is null
    Call stack:
    UnityEditor.SerializedObject..ctor (UnityEngine.Object[] objs, UnityEngine.Object context) (at /Users/builduser/buildslave/unity/build/Editor/Mono/SerializedObject.bindings.cs:39)
    UnityEditor.Editor.GetSerializedObjectInternal () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:553)
    UnityEditor.Editor.get_serializedObject () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:452)
    UnityEditor.UIElements.InspectorElement..ctor (UnityEditor.Editor editor, UnityEditor.UIElements.InspectorElement+Mode mode) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorElement.cs:133)
    UnityEditor.UIElements.EditorElement.Init () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/EditorElement.cs:84)
    UnityEditor.UIElements.EditorElement..ctor (System.Int32 editorIndex, UnityEditor.InspectorWindow iw) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/EditorElement.cs:62)
    UnityEditor.InspectorWindow.DrawEditors (UnityEditor.Editor[] editors) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1392)
    UnityEditor.InspectorWindow.RebuildContentsContainers () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:639)
    UnityEditor.InspectorWindow.RedrawFromNative () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:311)
    When I remove this attribute from PhotonView Unity stops to generate the error in Console. I tried this in our current project and in the empty project with PUN 2 imported. It reproduced in both cases. I used macOS 10.14.4. To reproduce the issue you need to attach any script from default assembly to any GameObject. It can be PhotonView for example or any other MonoBehaviour derived script that is located under Assets. But it should not be in asmdef or inside DLL in this case the issue is not reproducible.
  • Hi,

    I can not reproduce this, can you zip the repro project with just pun that expose this issue or a more accurate repro steps?





    Bye,

    Jean