x


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!

more ▼

asked Apr 05 '10 at 08:26 PM

Adam Mechtley gravatar image

Adam Mechtley
195 8 9 16

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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)

more ▼

answered Apr 05 '10 at 09:05 PM

Lucas Meijer 1 gravatar image

Lucas Meijer 1 ♦♦
8k 19 43 85

Terrific thanks!

Apr 05 '10 at 10:15 PM Adam Mechtley
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5273
x1729
x351
x75
x51

asked: Apr 05 '10 at 08:26 PM

Seen: 859 times

Last Updated: Apr 05 '10 at 08:26 PM