void FindLoadedTextures() {
		Texture[] textures = (Texture[])Resources.FindObjectsOfTypeAll (typeof(Texture));
		foreach (Texture t in textures) {
			TextureAnalysis ta = new TextureAnalysis(t);
			if( ta.IsProjectAsset ) {
				analysedTextures.Add ( ta );
			}
		}
	}
        public TextureAnalysis returnAnalysis()
        {
            var analysis = new TextureAnalysis {
                MaterialId      = this.MaterialId,
                EbsdPhoto       = this.EbsdPhoto,
                EbsdDescription = this.EbsdDescription
            };

            return(analysis);
        }
	void FindTextureDependencies() {
		List<Object> referencingObjects = new List<Object> (EditorUtility.CollectDependencies (new Object[] {
			dependencyRoot
		}));
		
		for (int j = 0; j < referencingObjects.Count; j++) {
			Object o = referencingObjects [j];
			Texture t = o as Texture;
				if( t ) {
				TextureAnalysis ta = new TextureAnalysis(t);
				if( ta.IsProjectAsset ) {
					analysedTextures.Add ( ta );
				}
			}
		}
	}
	void FilterOutDisplayedTextures() {

		List<Texture> displayedTextures = new List<Texture> ();

		Renderer[] renderers = (Renderer[])Resources.FindObjectsOfTypeAll (typeof(Renderer));
		foreach (Renderer r in renderers) {
			Material[] materials = r.sharedMaterials;
			foreach( Material m in materials ) {
				if( m && m.mainTexture ) {
					displayedTextures.Add(m.mainTexture);
				}
			}
		}

		foreach (Texture t in displayedTextures) {
			TextureAnalysis ta = FindTextureAnalysis(t);
			analysedTextures.Remove(ta);
		}
	}
 public TextureAnalysis Create(TextureAnalysis newTextureAnalysis)
 {
     _context.TextureAnalyses.Add(newTextureAnalysis);
     _context.SaveChanges();
     return(newTextureAnalysis);
 }