Search Unity

Unity 3.3 - Resources does not contain a definition for LoadAssetAtPath

Discussion in 'Editor & General Support' started by emogie, Mar 5, 2011.

  1. emogie

    emogie

    Joined:
    Aug 17, 2010
    Posts:
    3
    Hi all,

    (what else, i'm a noob ;) )

    i have in my project the TerrainToolkit.

    Today i've updated to Version 3.3 of unity3d, after it i get the error message:
    Assets/TerrainToolkit/Editor/TerrainToolkitEditor.cs(39,63): error CS0117: `Resources' does not contain a definition for `LoadAssetAtPath'

    Code-Line:
    terrain.guiSkin = (GUISkin) Resources.LoadAssetAtPath("Assets/TerrainToolkit/Editor/Resources/TerrainErosionEditorSkin.guiskin", typeof(GUISkin));

    No types in the Class Resource didn't have a Load... -definition

    Maybe a bug (could someone confirm it)? anyone is knowing a workaround?

    EDIT:
    Reinstallation of unity 3.3 didn't resolves the problem (no corrupt installation)
    Downgrade to Unity 3.2 didn't resolves the problem too :(

    EDIT2:
    MonoDevelop -> Unresolved Member LoadAssetAtPath

    EDIT3:
    I already sent a Bug Report, but could be nice if someone could confirm it.

    thanks in advance,
    Andreas
     
    Last edited: Mar 6, 2011
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    It's not a bug, you have a script called Resources, so Unity can't figure out what you mean.

    --Eric
     
  3. emogie

    emogie

    Joined:
    Aug 17, 2010
    Posts:
    3
    Hi Eric5h5,

    thanks for your hint,

    but it haven't a script with the name Resources in my Project.

    EDIT: In a new Project the error didn't occurs, so my project is maybe corrupt.
    Ok, i start a new Project.

    Thanks for your help.

    EDIT2:
    I had an folder in my Project called "path", after i deleted it, the error didn't occurs again, I think this error occurs only, if TerrainToolkit and the path is in the same Project. But didn't know at the moment from which location i have took this path folder (i belive from the asset store, but i'm not sure, and whats wondering me is that this error was occurs after the update to Unity 3.3).

    So I think its somewhere my fault.

    EDIT3:
    Yep it is the AI* Path in combination with the TerrainToolkit btw and other Packages.

    kind regards,
    Andreas
     
    Last edited: Mar 6, 2011
  4. nolver

    nolver

    Joined:
    Mar 14, 2011
    Posts:
    2
    Hi, you can resolve this problem very easily by fully qualifying the method calls, so the compiler no longer messes up finding two classes that are called "Resources".

    To do so, just change every trouble making appearance of Resources.Load for UnityEngine.Resources.Load
     
    fishedoutnow likes this.