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.
Merge pull request #10 from kurone-kito/cumulative-updates
v0.6.0: Added a new component, `ToggleWithAnimator` and cumulative updates
- Loading branch information
Showing
59 changed files
with
8,665 additions
and
33 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"compressWiki": true, | ||
"ignoredFiles": ["*.svg"] | ||
} |
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 +1 @@ | ||
dotnet 6.0.420 | ||
dotnet 6.0.421 |
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
56 changes: 56 additions & 0 deletions
56
Packages/black.kit.toybox/Editor/Concretes/ToggleWithAnimatorEditor.cs
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,56 @@ | ||
using UnityEditor; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
namespace black.kit.toybox.Editor | ||
{ | ||
/// <summary> | ||
/// The inspector of the <see cref="ToggleWithAnimator"/>. | ||
/// </summary> | ||
[CustomEditor(typeof(ToggleWithAnimator))] | ||
public sealed class ToggleWithAnimatorEditor | ||
: EditorBase<ToggleWithAnimator> | ||
{ | ||
/// <summary>The usage of the target.</summary> | ||
private readonly string[] usage = new[] | ||
{ | ||
T.USAGE_LINK_ANIMATOR, | ||
T.USAGE_LINK_TOGGLE, | ||
T.USAGE_GLOBAL_TOGGLE_1, | ||
}; | ||
|
||
/// <summary>Initialize the editor.</summary> | ||
public ToggleWithAnimatorEditor() | ||
: base(L10n.Tr(T.DETAIL_TOGGLE_WITH_ANIMATOR)) | ||
{ | ||
} | ||
|
||
/// <summary>The callback to draw the inspector GUI.</summary> | ||
public override void OnInspectorGUI() | ||
{ | ||
DrawBanner(); | ||
DrawDetails(); | ||
EditorGUILayout.BeginVertical(GUI.skin.box); | ||
DrawList( | ||
usage, new ListOptions() { Ordered = true, Tr = L10n.Tr }); | ||
DrawUdonEvent(T.USAGE_ON_VALUE_CHANGED); | ||
EditorGUILayout.EndVertical(); | ||
base.OnInspectorGUI(); | ||
|
||
serializedObject.Update(); | ||
var animator = AutoCompleteObject<Animator>( | ||
ToggleWithAnimator.NAME_ANIMATOR); | ||
var toggle = AutoCompleteObject<Toggle>( | ||
ToggleWithAnimator.NAME_TOGGLE); | ||
var param = serializedObject.FindProperty( | ||
ToggleWithAnimator.NAME_PARAMETER); | ||
if (animator) | ||
{ | ||
animator.SetBool( | ||
param.stringValue, toggle && toggle.isOn); | ||
animator.Update(Time.deltaTime * 100f); | ||
} | ||
serializedObject.ApplyModifiedProperties(); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Packages/black.kit.toybox/Editor/Concretes/ToggleWithAnimatorEditor.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
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
8 changes: 8 additions & 0 deletions
8
Packages/black.kit.toybox/Examples/Animation/ToggleWithAnimator.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.