- Home /
 
               Question by 
               Adam-Mechtley · Apr 05, 2010 at 08:26 PM · 
                editoreditor-scriptingassetdatabaseassetpostprocessor  
              
 
              Is there a way to get a unique hash for an asset?
I have an editor script that generates new assets (scripts) that need to be coupled with their source files in some way in case the source file is moved or renamed in the project. Is there any way to get a unique hash for an asset so I can maintain this coupling, or is there a different way to approach this problem? Thanks!
               Comment
              
 
               
               
               Best Answer 
              
 
              Answer by Lucas Meijer 1 · Apr 05, 2010 at 09:05 PM
Hey Adam,
AssetDatabase.AssetPathToGUID lets you do this.
Actually, it's not a hash, but its an identifier. If the asset (lets say a texture) gets updated by photoshop, it keeps this identifier. (while a hash would change)
Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                