Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

PhotonCloud

Discussion in 'Editor & General Support' started by jorn818, Nov 15, 2014.

  1. jorn818

    jorn818

    Joined:
    May 12, 2013
    Posts:
    97
    I have this error:
    Assets/Photon Unity Networking/Plugins/PhotonNetwork/Extensions.cs(187,21): error CS0101: The namespace `global::' already contains a definition for `GameObjectExtensions'


    part of script with the mistake:

    /// <summary>Small number of extension methods that make it easier for PUN to work cross-Unity-versions.</summary>
    public static class GameObjectExtensions
    {
    /// <summary>Unity-version-independent replacement for active GO property.</summary>
    /// <returns>Unity 3.5: active. Any newer Unity: activeInHierarchy.</returns>
    public static bool GetActive(this GameObject target)
    {
    #if UNITY_3_5
    return target.active;
    #else
    return target.activeInHierarchy;
    #endif
    }

    #if UNITY_3_5
    /// <summary>Unity-version-independent setter for active and SetActive().</summary>
    public static void SetActive(this GameObject target, bool value)
    {
    target.active = value;
    }
    #endif
    }
     
  2. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,657
    It means that there is already a Script with a Class called "GameObjectExtensions" in your Project.
     
  3. jorn818

    jorn818

    Joined:
    May 12, 2013
    Posts:
    97
    Thanks :D I already thought that was the case, but when I type in the name in the search bar I get no results?!
     
  4. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,657
    That bar only searches for file names. Do you use MonoDevelop by any chance?

    Open any script (it doesn't matter which one) inside MD, go to Search > Find in Files and a window should appear. Enter "GameObjectExtensions" into the "File:" field and choose "Current Project" from the "Look in:" dropdown list, then hit the "Find" button. MonoDevelop will now search through your entire Project in all files for that particular word you've entered before. It should take only a few seconds.
     
    jorn818 likes this.
  5. jorn818

    jorn818

    Joined:
    May 12, 2013
    Posts:
    97
    Found it in the ProBuilder asset of FPSControl Thanks! for your help! Really love how the Unity community really tries to help