Поскольку плагин Unity, упомянутый выше, отображает в игровой сцене только персонажа, когда я нажимаю кнопку «Готово», я пытаюсь добавить код в файл UmazingCC.cs для отображения как персонажа, так и изображения. Имя добавлено на вкладку, чтобы показать их обоих в игровой сцене.
Исходный код детали UmazingCC следующий
Код: Выделить всё
if (GUILayout.Button("Done", bottomBarButtonStyle)){
// Save the character, fade out the camera and load up the game scene
GameObject avatarGO;
if (selectedGender == "Man") {
avatarGO = maleAvatarSpawn;
} else {
avatarGO = femaleAvatarSpawn;
}
var avatar = avatarGO.GetComponent();
if( avatar != null )
{
string finalPath = savePath + "/" + characterName + ".txt";
if (finalPath.Length != 0)
{
PersistentNameHolder.characterName = characterName;
var asset = ScriptableObject.CreateInstance();
asset.Save(avatar.umaData.umaRecipe, avatar.context);
System.IO.File.WriteAllText(finalPath, asset.recipeString);
ScriptableObject.Destroy(asset);
// If the camera has a fader, make it fade out and load the game scene, otherwise just load the scene ourselves
if (orbitCamera.GetComponent() != null) {
orbitCamera.GetComponent().fadeOutAndLoadScene(gameSceneName);
} else {
Application.LoadLevel(gameSceneName);
}
Код: Выделить всё
void FinishWindowContents (int windowID) {
GUILayout.BeginHorizontal(horizontalLayoutStyle);
GUILayout.BeginVertical(verticalLayoutStyle);
GUILayout.Label ("Nombre", bottomBarLabelStyle);
characterName = GUILayout.TextField(characterName);
GUILayout.EndVertical();
GUILayout.BeginVertical(verticalLayoutStyle);
if (characterName.Length == 0) {
GUI.enabled = false;
}
Подробнее здесь: https://stackoverflow.com/questions/310 ... ity-plugin
Мобильная версия