ui: implement replace object UI and add screenshots to docs

This commit is contained in:
bd_ 2023-07-30 02:11:21 +09:00
parent 3f5a52859f
commit 9609328cf0
9 changed files with 34 additions and 3 deletions

View File

@ -0,0 +1,23 @@
using UnityEditor;
using static nadena.dev.modular_avatar.core.editor.Localization;
namespace nadena.dev.modular_avatar.core.editor
{
[CustomEditor(typeof(ModularAvatarReplaceObject))]
internal class ReplaceObjectEditor : MAEditorBase
{
private SerializedProperty _targetObject;
protected void OnEnable()
{
_targetObject = serializedObject.FindProperty("targetObject");
}
protected override void OnInnerInspectorGUI()
{
EditorGUILayout.PropertyField(_targetObject, G("replace_object.target_object"));
Localization.ShowLanguageUI();
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 721b66e4ba3e401585052315355a47e4
timeCreated: 1690650283

View File

@ -150,5 +150,6 @@
"menuitem.prop.is_default": "Is Group Default",
"animation_gen.duplicate_binding": "Controls from different control groups are trying to animate the same parameter. Parameter: {0}",
"animation_gen.multiple_defaults": "Multiple default menu items were found in the same control group.",
"menuitem.misc.add_item": "Add menu item"
"menuitem.misc.add_item": "Add menu item",
"replace_object.target_object": "Object to replace"
}

View File

@ -148,5 +148,6 @@
"menuitem.prop.is_default": "グループの初期設定にする",
"animation_gen.duplicate_binding": "別々のコントロールグループから、同じパラメーターが操作されています。パラメーター:{0}",
"animation_gen.multiple_defaults": "同じコントロールグループに初期設定に指定されたメニューアイテムが複数あります。",
"menuitem.misc.add_item": "メニューアイテムを追加"
"menuitem.misc.add_item": "メニューアイテムを追加",
"replace_object.target_object": "上書き先"
}

View File

@ -7,6 +7,5 @@ namespace nadena.dev.modular_avatar.core
public class ModularAvatarReplaceObject : AvatarTagComponent
{
public AvatarObjectReference targetObject = new AvatarObjectReference();
// public bool deleteChildren;
}
}

View File

@ -1,5 +1,7 @@
# Replace Object
![Replace Object](replace-object.png)
The Replace Object component allows you to completely replace the contents of a GameObject on the parent avatar.
## When should I use it?

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -1,5 +1,7 @@
# Replace Object
![Replace Object](replace-object.png)
Replace Objectコンポーネントを使うことで、任意のGameObjectの内容を完全に置き換えることができます。
## どんな時に使うべきか?

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB