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 ?
is there somthing to do wirh unity prefs ? (app path or thing like that) !
Answer by fugundo · Apr 04, 2017 at 06:47 PM
using mono what can cause this trouble ? @hexagonius
mono sometimes gets out of sync with unity. you then choose Edit -> Open C# Project
Answer by domiii · Jan 10, 2018 at 07:17 AM
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
.
Your answer
Follow this Question
Related Questions
Menu object not responding 0 Answers
ArgumentOutOfRangeException is occuring when it shouldn't 0 Answers
Unexpected symbol error in shader script 0 Answers