public void RandomizeModel() { ModelInfos.Randomize(); GenderText.text = ModelInfos.Gender.ToString(); SkinToneText.text = ModelInfos.SkinTone.ToString(); HairTypeText.text = ModelInfos.HairType.ToString(); HairColorText.text = ModelInfos.HairColor.ToString(); NeedUpdateModel = true; }
public static GameObject BuildModel(HumanModelInfos modelInfos, UnitEquipment unitEquipment) { GameObject model = GameObject.Instantiate((GameObject)Resources.Load("Body/Template", typeof(GameObject))); if (modelInfos == null) { modelInfos = new HumanModelInfos(); modelInfos.Randomize(); } AddHair(model, modelInfos); AddBody(model, modelInfos, unitEquipment.Body); AddHead(model, unitEquipment.Head); AddBack(model, unitEquipment.Back); AddWeapons(model, unitEquipment.RightWeapon, unitEquipment.LeftWeapon); return(model); }