The in-game dressup system has always been an integral part of the game, how do you make it in unity? What problems should be noticed in dressup? Next we will discuss the above two issues.
Dress up is divided into two types, one type is for the static model of the dress, is directly the body needs to change the mesh can be replaced. Another type is the facelift for dynamic, action-based models. For the former, if the model movement will appear dislocation or the direction of the wrong situation, and the latter just make up for the occurrence of this situation. So we are mainly Avatar Dressup for the latter.
The realization of Dressup:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/58/27/wKioL1Sqm9uh8oicAAE-_7UdjHM140.jpg "style=" float: none; "title=" 1.jpg "alt=" Wkiol1sqm9uh8oicaae-_7udjhm140.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/58/2A/wKiom1Sqmx7h4cJrAAE3ZeNAccA254.jpg "style=" float: none; "title=" 2.jpg "alt=" Wkiom1sqmx7h4cjraae3zenacca254.jpg "/>
The above is to replace the trousers during the movement of the model. The others are treated the same way.
What is the principle of Avatar Dressup?
First, need a set of movement skeleton.
Second, the need to dress up the parts mesh.
It is necessary to bind the mesh of each part to the skeleton, and in the course of the skeleton movement, the mesh bound to it will follow the motion together.
The various parts of mesh are shown in unity in the same effect as:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/58/2A/wKiom1Sqm7vwB65-AACoifhvxNA015.jpg "title=" 3.jpg " alt= "Wkiom1sqm7vwb65-aacoifhvxna015.jpg"/>
Is that we need to replace the model is two sets such as head-001 and head-003, is the corresponding two sets of mesh need to replace each other.
We also need a set of action skeletons that can't be seen in unity and we don't show it.
Next is the code implementation:
The first step is to load the parts of the mesh that need to be replaced
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/58/27/wKioL1SqnVaxS8lZAAFUblcZNM8731.jpg "title=" 4.jpg " alt= "Wkiol1sqnvaxs8lzaafublcznm8731.jpg"/>
The second step is to load the skeleton that needs to bind the mesh:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/58/27/wKioL1SqnjiyMFx0AAEY090_JZI376.jpg "title=" 5.jpg " alt= "Wkiol1sqnjiymfx0aaey090_jzi376.jpg"/>
So we finished the dress up, using a set of skeletons, you can bind multiple avatar, the effect is as follows:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/58/27/wKioL1SqnyTzi7lOAAIU0Gk3euU192.jpg "title=" 6.jpg " alt= "Wkiol1sqnytzi7loaaiu0gk3euu192.jpg"/>
Isn't it simple?
Unity 3D Avatar Dressup System