Skip to content

Commit

Permalink
feat(TweenHandler): Add test keys
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed May 4, 2024
1 parent 99e2e79 commit cd4c425
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions Assets/JCSUnity/Scripts/Handler/JCS_TweenerHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,25 @@ public class JCS_TweenerHandler : MonoBehaviour
{
/* Variables */

[Separator("Check Variables (JCS_TweenPanel)")]
#if UNITY_EDITOR
[Separator("Helper Variables (JCS_TweenerHandler)")]

[Tooltip("")]
[Tooltip("Test component with key?")]
[SerializeField]
private bool mTestWithKey = false;

[Tooltip("Key to active tween to starting value.")]
[SerializeField]
private KeyCode mTweenToStart = KeyCode.J;

[Tooltip("Key to active tween to target value.")]
[SerializeField]
private KeyCode mTweenToTarget = KeyCode.K;
#endif

[Separator("Check Variables (JCS_TweenerHandler)")]

[Tooltip("Optional panel root.")]
[SerializeField]
[ReadOnly]
private JCS_PanelRoot mPanelRoot = null;
Expand Down Expand Up @@ -73,6 +89,20 @@ private void Start()
}
}

#if UNITY_EDITOR
private void Update()
{
if (!mTestWithKey)
return;

if (Input.GetKeyDown(mTweenToStart))
DoAllTweenToStartValue();

if (Input.GetKeyDown(mTweenToTarget))
DoAllTweenToTargetValue();
}
#endif

/// <summary>
/// Check if done tweeening for all tweeners.
/// </summary>
Expand Down

0 comments on commit cd4c425

Please sign in to comment.