UMA Wiki

Unity Multipurpose Avatar

User Tools

Site Tools


knowledgebase:dna

DNA

The Dna of a UMA avatar are the possible changes or deformations that can be made to customize an avatar.

These individual pieces can be accessed and changed at runtime to see immediate results on the “UMAData” component.

Setting Dna at runtime from code

When using a DynamicCharacterAvatar for modifying DNA in code use the DnaSetter class.

DynamicCharacterAvatar can call GetDNA() which returns a Dictionary<string,DnaSetter> of all the dna on the avatar.

Dictionary<string,DnaSetter> AllDNA = Avatar.GetDNA();

the DnaSetter can call Set(float val) to set the dna value. Then rebuild the avatar and the changes will take affect.

public void ValueChanged(float value)
{
   DNA.Set(value);
   Avatar.ForceUpdate(true);
}
knowledgebase/dna.txt · Last modified: 2018/04/14 14:32 by secretanorak