Skip to content

Commit

Permalink
feat: added the sequence active relay to animation
Browse files Browse the repository at this point in the history
  • Loading branch information
kurone-kito committed Feb 11, 2024
1 parent 2db5eae commit 6e9424a
Show file tree
Hide file tree
Showing 21 changed files with 2,774 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

namespace black.kit.toybox.Editor
{
/// <summary>
/// The inspector of the <see cref="SequenceActiveRelayToAnimator"/>.
/// </summary>
[CustomEditor(typeof(SequenceActiveRelayToAnimator))]
public class SequenceActiveRelayToAnimatorEditor : EditorBase<SequenceActiveRelayToAnimator>
{
/// <summary>Initialize the editor.</summary>
public SequenceActiveRelayToAnimatorEditor()
: base(L10n.Tr(T.DETAIL_SEQUENCE_ACTIVE_RELAY_TO_ANIMATOR))
{
}

/// <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_TO_ANIMATOR), style);
EditorGUILayout.EndVertical();
base.OnInspectorGUI();

serializedObject.Update();
AutoCompleteObject<Animator>(
SequenceActiveRelayToAnimator.NAME_ANIMATOR);
serializedObject.ApplyModifiedProperties();
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Packages/black.kit.toybox/Editor/T.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public static class T
public const string DETAIL_GLOBAL_TOGGLE = nameof(DETAIL_GLOBAL_TOGGLE);
public const string DETAIL_OBSERVER_HUB = nameof(DETAIL_OBSERVER_HUB);
public const string DETAIL_POSITION_ANCHOR = nameof(DETAIL_POSITION_ANCHOR);
public const string DETAIL_SEQUENCE_ACTIVE_RELAY_TO_ANIMATOR =
nameof(DETAIL_SEQUENCE_ACTIVE_RELAY_TO_ANIMATOR);
public const string DETAIL_SUBJECT = nameof(DETAIL_SUBJECT);
public const string DETAIL_TICKING_DOWN = nameof(DETAIL_TICKING_DOWN);
public const string DETAIL_WHITELIST = nameof(DETAIL_WHITELIST);
Expand All @@ -27,6 +29,7 @@ public static class T
public const string USAGE_SEND_CUSTOM_EVENT = nameof(USAGE_SEND_CUSTOM_EVENT);
public const string USAGE_THIS_COMPONENT = nameof(USAGE_THIS_COMPONENT);
public const string USAGE_TICKING_DOWN = nameof(USAGE_TICKING_DOWN);
public const string USAGE_TO_ANIMATOR = nameof(USAGE_TO_ANIMATOR);
public const string WARN_AVOID_EMPTY_ARRAY = nameof(WARN_AVOID_EMPTY_ARRAY);
public const string WARN_CIRCULAR_REFERENCE = nameof(WARN_CIRCULAR_REFERENCE);
}
Expand Down
6 changes: 6 additions & 0 deletions Packages/black.kit.toybox/Editor/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ msgstr "Use this ObserverHub when you have many Observers registered in a Subjec
msgid "DETAIL_POSITION_ANCHOR"
msgstr "The component maintains coordinate information when active and inactive and switches coordinate information the moment the active state changes."

msgid "DETAIL_SEQUENCE_ACTIVE_RELAY_TO_ANIMATOR"
msgstr "This component transfers parameters to the Animator component of the specified object according to a predetermined sequence when the active state changes."

msgid "DETAIL_SUBJECT"
msgstr "When the <b>Notify()</b> method is executed, the registered Observers are notified simultaneously."

Expand Down Expand Up @@ -77,6 +80,9 @@ msgstr "Reference: <b>This component</b>"
msgid "USAGE_TICKING_DOWN"
msgstr "1. place it on the same object as the <b>Text</b> or <b>TextMeshProUGUI</b> component or manually tie it."

msgid "USAGE_TO_ANIMATOR"
msgstr "1. place it on the same object as the <b>Animator</b> component or manually tie it."

msgid "WARN_AVOID_EMPTY_ARRAY"
msgstr "To avoid extra load, it is recommended that the array's contents be packed as tightly as possible with no spaces."

Expand Down
6 changes: 6 additions & 0 deletions Packages/black.kit.toybox/Editor/ja.po
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ msgstr "このコンポーネントは、Subjectに多くのObserverを登録し
msgid "DETAIL_POSITION_ANCHOR"
msgstr "このコンポーネントは、アクティブと非アクティブに転送する座標情報を保持し、アクティブ状態が変化した際に指定オブジェクトをそこへ転送させます。"

msgid "DETAIL_SEQUENCE_ACTIVE_RELAY_TO_ANIMATOR"
msgstr "このコンポーネントは、アクティブ状態が変化した際に指定オブジェクトのAnimatorコンポーネントへ、所定のシーケンスに従ってパラメーターを転送します。"

msgid "DETAIL_SUBJECT"
msgstr "<b>Notify()</b>メソッドを実行すると、登録されたObserverに同時に通知されます。"

Expand Down Expand Up @@ -77,6 +80,9 @@ msgstr "参照: <b>このコンポーネント</b>"
msgid "USAGE_TICKING_DOWN"
msgstr "1.TextまたはTextMeshProUGUIコンポーネントと同じオブジェクトに配置するか、手動で紐づけてください。"

msgid "USAGE_TO_ANIMATOR"
msgstr "1.Animatorコンポーネントと同じオブジェクトに配置するか、手動で紐づけてください。"

msgid "WARN_AVOID_EMPTY_ARRAY"
msgstr "余分な負荷を避けるため、配列の内容はできるだけ空白を含まないように詰めることをお勧めします。"

Expand Down
8 changes: 8 additions & 0 deletions Packages/black.kit.toybox/Examples/Animation.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1107 &-4997256735757413598
AnimatorStateMachine:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: -854708630700727579}
m_Position: {x: 20, y: 180, z: 0}
- serializedVersion: 1
m_State: {fileID: 2066181417889339146}
m_Position: {x: 20, y: 240, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 50, y: 70, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: -854708630700727579}
--- !u!1101 &-1088427316265223487
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: Zoomed
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 2066181417889339146}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 1
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &-854708630700727579
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Idle
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: -1088427316265223487}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 92ab4e3aa9ed96d498c0547b568f5cc0, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Cube
serializedVersion: 5
m_AnimatorParameters:
- m_Name: Zoomed
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: -4997256735757413598}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1102 &2066181417889339146
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Zoomed
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 7079886549322114387}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: f1c30d3249e93ac4b88ee4dbccaa4a1f, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &7079886549322114387
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 2
m_ConditionEvent: Zoomed
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -854708630700727579}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 1
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6e9424a

Please sign in to comment.