角色模型和UMA
Changing the Character Models
The standard atavism login scene provides a very easy way to change the models the player’s characters can use. You can use whatever models you want for the characters in your game by following these two steps:
1) Create the prefabs
Prefabs of your models need to be placed in the Resources folder in Unity. Once you have your prefab you need to add 4 components:
- MobController3D
- Character Controller
- Atavism Mob Appearance
- Mob Sound Set
The mob controller script helps handle animations and mob appearance is used to handle equipping items. Take a look at the example prefabs provided (the Knight and Princess) to get an idea of what it should look like.
Your model will also either need an Animation or Animator component on it to be able to do animations. If using the Animation component (the Unity legacy animation system) you will need to drag animations into the animation slots in the MobController. These also need to exist on the Animation component.
2) Change the Character Prefab settings in the Character Scene
From Atavism 2.6 onwards the character system has been improved. The updated instructions are below:
Go into the AtavismObjects/CharacterCreateObjects folder. If you want to change the existing race models, select the HumanRace prefab, or to create another race in addition to Human, duplicate the HumanRace prefab.
Note: If you did duplicate the existing prefab, update the Race Name and Race Icon properties on the new prefab.
To set the models you want to use for your race, drag the model prefabs from the Resources folder into the Female Character Prefab or Male Character Prefab slot on the Atavism Race Data component.
If you only edited the existing HumanRace prefab, you can save your project and give it a try – nothing else needs to be done.
If you created any new AtavismRaceData prefabs you will now need to add them to the Character Selection scene. Go into the Character Selection scene and work your way down through Canvas → Character Creation → Character_Creation_left. Currently there is only one race button (named “Race Button 1”). Duplicate that Race Button 1 and reposition it to your liking. Now drag your new AtavismRaceData prefab into the “Race Data” property in the UGUI Character Race Slot component on the new Race Button.
With the new Race Button created, select the CharacterSelectCreate object in the scene and find the Races property. Increase the size, then drag the new button into the new Element that showed up. Save your scene then give it a try.
Now when a player goes to the character creation scene they will see your character prefabs listed.
Setting up UMA in Atavism
This guide covers setting up the UMA system to work with the Atavism system.
The general idea is the normal login scene is replaced with the login scene provided in the package. Follow the steps below to get it working.
- Start with a unity project that has the atavism package installed.
- Import the UMA-Atavism package.
- Run the game and see how it goes.
Note: if you login to an account that already has non UMA characters it will error out when logging in. The UMA system is not compatible with other characters.