How add code lines in Umazing unity plugin?

90 Views Asked by At

enter image description here Since that the Unity Plugin mentioned above display only the Character into the Game Scene when I cliked the button DONE, I am trying to add code into UmazingCC.cs file to display both Character and the Name added in the tab to show both of them in the Game Scene. The original UmazingCC part code is the following

enter code hereif (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<UMAAvatarBase>();
        if( avatar != null )
        {
            string finalPath = savePath + "/" + characterName + ".txt";
            if (finalPath.Length != 0)
            {
                PersistentNameHolder.characterName = characterName;

                var asset = ScriptableObject.CreateInstance<UMATextRecipe>();
                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<CameraFader>() != null) {
                    orbitCamera.GetComponent<CameraFader>().fadeOutAndLoadScene(gameSceneName);
                } else {
                    Application.LoadLevel(gameSceneName);
                }

The Name metod code is the following

enter code here 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;
    }

For it, Could anybody say me what code lines should I add in this place to show both Character and its name in the Game Scene?

Thanks in advance and sorry for my little english. Ps. I added a screen image to see better the problem.

0

There are 0 best solutions below