generated from kurone-kito/vpm-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kurone-kito/add-new-partsからプルリクエスト#9をマージする
v0.5.0: Added some UI prefabs and cumulative updates
- Loading branch information
Showing
143 changed files
with
81,482 additions
and
4,873 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
{ | ||
"recommendations": [ | ||
"editorconfig.editorconfig", | ||
"fernandoescolar.vscode-solution-explorer", | ||
"redhat.vscode-yaml", | ||
"streetsidesoftware.code-spell-checker", | ||
"visualstudiotoolsforunity.vstuc" | ||
"visualstudiotoolsforunity.vstuc", | ||
"zbecknell.t4-support" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using UnityEditor; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
using black.kit.toybox.Editor; | ||
|
||
namespace black.kit.vrcui.Editor | ||
{ | ||
/// <summary>The inspector of the <see cref="Hero"/>.</summary> | ||
[CustomEditor(typeof(Hero))] | ||
public sealed class HeroEditor : EditorBase<Hero> | ||
{ | ||
/// <summary>The usage of the target.</summary> | ||
private readonly string[] usage = new string[] | ||
{ | ||
T.USAGE_REGIST_SPRITES, | ||
T.USAGE_HERO_1, | ||
}; | ||
|
||
/// <summary>Initialize the editor.</summary> | ||
public HeroEditor() : base(L10n.Tr(T.DETAIL_HERO)) | ||
{ | ||
} | ||
|
||
/// <summary>The callback to draw the inspector GUI.</summary> | ||
public override void OnInspectorGUI() | ||
{ | ||
DrawBanner(); | ||
DrawDetails(); | ||
EditorGUILayout.BeginVertical(GUI.skin.box); | ||
var style = defaultStyle.Value; | ||
EditorGUILayout.LabelField(L10n.Tr(T.USAGE_COMPONENT), style); | ||
EditorGUILayout.Space(); | ||
DrawList( | ||
usage, | ||
new ListOptions(ordered: true, tr: (t) => L10n.Tr(t))); | ||
EditorGUILayout.EndVertical(); | ||
base.OnInspectorGUI(); | ||
|
||
serializedObject.Update(); | ||
var image = AutoCompleteObject<Image>(Hero.NAME_IMAGE); | ||
if (image) | ||
{ | ||
image.sprite = GetSprite(); | ||
} | ||
serializedObject.ApplyModifiedProperties(); | ||
} | ||
|
||
/// <summary>Get the sprite of the icon.</summary> | ||
/// <returns>The sprite of the icon.</returns> | ||
private Sprite GetSprite() | ||
{ | ||
var (sprites, index, _) = GetArrayProperty( | ||
Hero.NAME_SPRITES, TypedTarget.Index); | ||
if (index < 0) | ||
{ | ||
return null; // 'sprites' is empty | ||
} | ||
var element = sprites.GetArrayElementAtIndex(index); | ||
return element.objectReferenceValue as Sprite; | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Packages/black.kit.vrcui/Editor/Concreted/HeroEditor.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using TMPro; | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace black.kit.vrcui.Editor | ||
{ | ||
/// <summary>The inspector of the <see cref="Select"/>.</summary> | ||
[CustomEditor(typeof(Select))] | ||
public sealed class SelectEditor : EditorBase<Select> | ||
{ | ||
/// <summary>Initialize the editor.</summary> | ||
public SelectEditor() : base(L10n.Tr(T.DETAIL_SELECT)) | ||
{ | ||
} | ||
|
||
/// <summary>The callback to draw the inspector GUI.</summary> | ||
public override void OnInspectorGUI() | ||
{ | ||
DrawBanner(); | ||
DrawDetails(); | ||
EditorGUILayout.BeginVertical(GUI.skin.box); | ||
var style = defaultStyle.Value; | ||
EditorGUILayout.LabelField(L10n.Tr(T.USAGE_COMPONENT), style); | ||
EditorGUILayout.Space(); | ||
EditorGUILayout.LabelField(L10n.Tr(T.USAGE_EVENT_BUTTON), style); | ||
DrawUdonEvent(L10n.Tr(T.USAGE_DECREMENT)); | ||
DrawUdonEvent(L10n.Tr(T.USAGE_INCREMENT)); | ||
EditorGUILayout.EndVertical(); | ||
base.OnInspectorGUI(); | ||
|
||
serializedObject.Update(); | ||
var (values, index, size) = | ||
GetArrayProperty(Select.NAME_VALUES, TypedTarget.Index); | ||
var text = AutoCompleteObject<TextMeshProUGUI>(Select.NAME_TEXT); | ||
if (text && size > 0) | ||
{ | ||
text.text = | ||
values.GetArrayElementAtIndex(index).stringValue; | ||
} | ||
serializedObject.ApplyModifiedProperties(); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Packages/black.kit.vrcui/Editor/Concreted/SelectEditor.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.