public void SaveAppearanceDetails() { LookConfig savedAppearance = new LookConfig(); savedAppearance.bodyType = myConfig.bodyType; savedAppearance.hairStyle = myConfig.hairStyle; savedAppearance.hairColour = myConfig.hairColour; savedAppearance.skinColour = myConfig.skinColour; savedAppearance.shirtStyle = myConfig.shirtStyle; }
public void Start() { myConfig = new LookConfig() { bodyType = bodyTypes[0], hairStyle = hairStyles[0], hairColour = hairColours[0], skinColour = skinTones[0], shirtStyle = shirtStyles[0] }; }
public void ApplyChanges(LookConfig myConfig, BodyPart details) { switch (details) { case BodyPart.Body: { body.GetComponent <SkinnedMeshRenderer>().sharedMesh = myConfig.bodyType; break; } case BodyPart.ShirtTexture: { body.GetComponent <SkinnedMeshRenderer>().material.mainTexture = myConfig.shirtStyle; break; } case BodyPart.SkinColor: { head.GetComponent <SkinnedMeshRenderer>().material.color = myConfig.skinColour; break; } case BodyPart.Hair: { foreach (Transform t in hair.transform) { Destroy(t.gameObject); } var hairGO = Instantiate(myConfig.hairStyle, hair.transform, false); foreach (MeshRenderer mesh in hair.GetComponentsInChildren <MeshRenderer>()) { mesh.material.color = myConfig.hairColour; } break; } } }