Skip to content

uuids, what are they? #3995

Answered by bjorn3
lukors asked this question in Q&A
Feb 20, 2022 · 2 comments · 1 reply
Discussion options

You must be logged in to vote
  1. A uuid is a universally unique id. See https://en.wikipedia.org/wiki/Universally_unique_identifier for more info.
  2. You should generate a random version 4 uuid. For example using https://www.uuidgenerator.net/ or by searching uuid on duckduckgo.
  3. Materials are a kind of asset. Every asset type needs a unique uuid as asset handles consist of either a path (not applicable for runtime generated assets like this one) or the combination of a uuid corresponding to the asset type and a random 64bit integer. See
    pub fn random<T: Asset>() -> Self {
    HandleId::Id(T::TYPE_UUID, rand::random())
    }

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@lukors
Comment options

Answer selected by lukors
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants