UnityEditor.PresetLibraryLocations.GetFileLocationFromPath C# (CSharp) Method

GetFileLocationFromPath() public static method

public static GetFileLocationFromPath ( string path ) : PresetFileLocation
path string
return PresetFileLocation
        public static PresetFileLocation GetFileLocationFromPath(string path)
        {
            if (path.Contains(InternalEditorUtility.unityPreferencesFolder))
            {
                return PresetFileLocation.PreferencesFolder;
            }
            if (!path.Contains("Assets/"))
            {
                Debug.LogError("Could not determine preset file location type " + path);
            }
            return PresetFileLocation.ProjectFolder;
        }

Usage Example

示例#1
0
 public PresetLibraryEditor(ScriptableObjectSaveLoadHelper <T> helper, PresetLibraryEditorState state, System.Action <int, object> itemClickedCallback)
 {
     this.m_SaveLoadHelper                    = helper;
     this.m_State                             = state;
     this.m_ItemClickedCallback               = itemClickedCallback;
     this.settingsMenuRightMargin             = 10f;
     this.useOnePixelOverlappedGrid           = false;
     this.alwaysShowScrollAreaHorizontalLines = true;
     this.marginsForList                      = new RectOffset(10, 10, 5, 5);
     this.marginsForGrid                      = new RectOffset(5, 5, 5, 5);
     this.m_PresetLibraryFileLocation         = PresetLibraryLocations.GetFileLocationFromPath(this.currentLibraryWithoutExtension);
 }
All Usage Examples Of UnityEditor.PresetLibraryLocations::GetFileLocationFromPath