Fusion.Build.BuildContext.ContentFileExists C# (CSharp) Method

ContentFileExists() public method

Try to resolve source file path. If succeded returns true. False otherwice.
public ContentFileExists ( string path ) : bool
path string
return bool
		public bool ContentFileExists ( string path )
		{
			try {
				ResolveContentPath( path );
				return true;
			} catch ( BuildException ) {
				return false;
			}
		}

Usage Example

Beispiel #1
0
        /// <summary>
        /// Return list of key path to changed content file.
        /// </summary>
        /// <returns></returns>
        public IEnumerable <string> GetRemovedDependencies()
        {
            var removedDeps = new List <string>();

            if (!TargetFileExists)
            {
                throw new InvalidOperationException("Target file does not exist");
            }

            using (var assetStream = AssetStream.OpenRead(FullTargetPath)) {
                foreach (var dependency in assetStream.Dependencies)
                {
                    if (!context.ContentFileExists(dependency))
                    {
                        removedDeps.Add(dependency);
                    }
                }
            }

            return(removedDeps);
        }