Search Unity

Question Namespace not found error... why?

Discussion in 'Scripting' started by danielesuppo, Sep 14, 2022.

  1. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Hello! I'm using the Oculus SDK, and I should modify a script of the SDK so to be able to use Photon for networking.
    I can't derive from it because it has not overridable methods, so I have to modify the original script.

    What is weird (for sure only to me) is that I can't add any external namespace in this script, so for example if I add
    Code (CSharp):
    1. Using Photon.Pun;
    I get the error "namespace Photon not found", but this namespace perfectly work in any other script outside the SDK folder.

    The script that I have to modify is inside this folder:
    "Oculus\Interaction\Runtime\Scripts\Interaction\Grabbable\OneGrabFreeTransfomer.cs"

    I've tried to move the script in a root folder, for example, but I get error from other scripts, saying that them can't find its namespace anymore...

    I have idea that the problem could be related to the path of the script, but I don't know if and how it could be fixed.

    Any help would be much appreciated!
    Thank-you
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,911
    The Oculus SDK lives in a separate assembly. That assembly doesn't have a reference to the Photon assembly. You can fix this by adding such a reference if you want, but really I don't see a good reason why you should need to modify the Oculus SDK to accomplish your goal. This question reeks of an XY problem:

    https://xyproblem.info/
     
  3. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Many thanks for the reply!
    I was missing the concept of assembly. Now it's totally clear.
    This was not an XY problem, in fact with few lines (instead of explaining the whole problem with a lot of words) I've perfectly understood, and I've not wasted my time writing, and your time reading ;)
    P.S. I've solved the problem by adding a couple of actions in the script