PostProcessingFactory.cs

Got a compiler error after installing post processing stack fom unity technologies :

Assets/PostProcessing/Editor/PostProcessingFactory.cs(20,33): error CS0117: Path' does not contain a definition for GetFileName’

the code :
namespace UnityEditor.PostProcessing
{
public class PostProcessingFactory
{
[MenuItem(“Assets/Create/Post-Processing Profile”, priority = 201)]
static void MenuCreatePostProcessingProfile()
{
var icon = EditorGUIUtility.FindTexture(“ScriptableObject Icon”);
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, ScriptableObject.CreateInstance(), “New Post-Processing Profile.asset”, icon, null);
}

        internal static PostProcessingProfile CreatePostProcessingProfileAtPath(string path)
        {
            var profile = ScriptableObject.CreateInstance<PostProcessingProfile>();
            profile.name = Path.GetFileName(path);
            AssetDatabase.CreateAsset(profile, path);
            return profile;
        }
    }

installed from asset store, No changes in code, using unity 5.5 !
where is the trouble please ?

using mono what can cause this trouble ? @hexagonius

Had the same problem. Turns out, Path is a very commonly used class name. I had a Script called Path which was colliding with System.IO.Path used in the Post Processing Stack. Instead of warning you about the ambiguity, it just pulls one of the two paths at random (possibly preferring the one in the global namespace) which is rather annoying.


How to fix this?

Just rename your own Path script (or, if you can, put your entire code into its own namespace), or explicitly prefix the Path with its namespace in PostProcessingFactory, replacing Path.GetFileName with System.IO.Path.GetFileName .