Class ProjectShaderChanges
Decides from the state of the disk, the project and the session what a batch of file events means for shader assets.
public static class ProjectShaderChanges
- Inheritance
-
objectProjectShaderChanges
Remarks
The folder part of a path from a file event can be lower case, so paths are compared without case.
Methods
IsBuiltFile(string)
Whether this is the path of a file that the build of the user shaders takes.
public static bool IsBuiltFile(string path)
Parameters
pathstring
Returns
IsShaderFile(string)
Whether this is the path of a file that has a shader asset.
public static bool IsShaderFile(string path)
Parameters
pathstring
Returns
IsTouched(string, string, FileEventChangeType, bool)
Whether a file event on this path can change the shader assets of the project in this folder.
public static bool IsTouched(string path, string projectDirectory, FileEventChangeType changeType, bool isDirectory)
Parameters
pathstringThe path of the event; a rename has two of them.
projectDirectorystringThe folder of the project file.
changeTypeFileEventChangeTypeThe type of the event.
isDirectoryboolWhether the event is about a folder. A deleted path can't tell.
Returns
IsUnder(string, string)
Whether the path is the folder or inside the folder.
public static bool IsUnder(string path, string directory)
Parameters
Returns
NeedsProjectItems(IEnumerable<string>, IEnumerable<string>, Func<string, bool>, Func<string, bool>)
Whether Plan(IEnumerable<string>, IEnumerable<string>, IEnumerable<string>, IEnumerable<string>, Func<string, bool>) needs the items of the project, which take an evaluation of the project to get.
public static bool NeedsProjectItems(IEnumerable<string> touchedPaths, IEnumerable<string> sessionFiles, Func<string, bool> fileExists, Func<string, bool> directoryExists)
Parameters
touchedPathsIEnumerable<string>sessionFilesIEnumerable<string>fileExistsFunc<string, bool>directoryExistsFunc<string, bool>
Returns
Plan(IEnumerable<string>, IEnumerable<string>, IEnumerable<string>, IEnumerable<string>, Func<string, bool>)
Computes the actions of a batch of file events. A path can be a shader file or a folder of them.
public static List<ProjectShaderChange> Plan(IEnumerable<string> touchedPaths, IEnumerable<string> sessionFiles, IEnumerable<string> projectItems, IEnumerable<string> deletedInSession, Func<string, bool> fileExists)
Parameters
touchedPathsIEnumerable<string>The paths of the file events.
sessionFilesIEnumerable<string>The files of the assets in the session.
projectItemsIEnumerable<string>The files the project includes.
deletedInSessionIEnumerable<string>The files of the assets deleted in the session and not saved yet.
fileExistsFunc<string, bool>Whether a file is on the disk now.
Returns
- List<ProjectShaderChange>
The actions, with each path taken from the session or from the project.