Unity3d 如何在Umazing unity插件中添加代码行?
由于上面提到的Unity插件在我点击“完成”按钮时只在游戏场景中显示角色,因此我尝试将代码添加到UmazingCC.cs文件中,以显示在选项卡中添加的角色和名称,从而在游戏场景中显示这两个角色和名称。 原始UmazingCC零件代码如下所示Unity3d 如何在Umazing unity插件中添加代码行?,unity3d,unityscript,Unity3d,Unityscript,由于上面提到的Unity插件在我点击“完成”按钮时只在游戏场景中显示角色,因此我尝试将代码添加到UmazingCC.cs文件中,以显示在选项卡中添加的角色和名称,从而在游戏场景中显示这两个角色和名称。 原始UmazingCC零件代码如下所示 enter code here void FinishWindowContents (int windowID) { GUILayout.BeginHorizontal(horizontalLayoutStyle); GUILayout.
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;
}
在此处输入代码
if(GUILayout.Button(“Done”,bottomBarButtonStyle)){
//保存角色,淡出相机并加载游戏场景
游戏对象化身
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);
}
对于它,有人能告诉我,我应该在这个地方添加什么代码行来显示游戏场景中的角色和名称吗
提前谢谢,对不起,我的英语不好。
另外,我添加了一个屏幕图像以更好地了解问题